import { Bell, BellOff, BellRing } from 'lucide-react';
import { useNotifications } from '../hooks/useNotifications';
interface NotificationSettingsProps {
compact?: boolean;
}
export function NotificationSettings({ compact = false }: NotificationSettingsProps) {
const { permission, requestPermission, isEnabled, setEnabled } = useNotifications();
const handleToggle = async () => {
if (permission === 'unsupported') {
return;
}
if (!isEnabled) {
// Enabling - request permission if needed
if (permission !== 'granted') {
const granted = await requestPermission();
if (granted) {
setEnabled(true);
}
} else {
setEnabled(true);
}
} else {
// Disabling
setEnabled(false);
}
};
if (permission === 'unsupported') {
return null;
}
const getIcon = () => {
if (!isEnabled) return