import { Switch } from "~/components/ui/switch"; import { Label } from "~/components/ui/label"; import { RadioGroup, RadioGroupItem } from "~/components/ui/radio-group"; import type { NotificationMode } from "~/hooks/useDraftNotifications"; interface NotificationSettingsProps { enabled: boolean; onEnabledChange: (enabled: boolean) => void; mode: NotificationMode; onModeChange: (mode: NotificationMode) => void; permissionState: NotificationPermission | "unsupported"; switchOnly?: boolean; } export function NotificationSettings({ enabled, onEnabledChange, mode, onModeChange, permissionState, switchOnly = false, }: NotificationSettingsProps) { if (permissionState === "unsupported") { return null; } if (switchOnly) { return ( <> {enabled && (
onModeChange(value as NotificationMode)} className="space-y-2" >
)} ); } return (
{permissionState === "denied" && (

Notifications blocked by browser. Update in browser settings to enable.

)} {enabled && ( onModeChange(value as NotificationMode)} className="space-y-2 mt-3" >
)}
); }