"use client"; import { SectionDivider, Toggle } from "@/modules/settings/components/panel/controls"; import { SETTINGS_PANEL_INSET } from "@/modules/settings/components/panel/surface"; import type { NotificationSettingsDraft } from "@/modules/settings/components/panel/types"; import { cn } from "@/lib/utils"; type NotificationsSectionProps = { draft: NotificationSettingsDraft; onChange: (patch: Partial) => void; }; function ThresholdRow({ label, description, value, unit, onChange, }: { label: string; description?: string; value: string; unit: string; onChange: (v: string) => void; }) { return (
{label}
{description && (
{description}
)}
onChange(e.target.value)} type="number" min={1} className="h-8 w-20 rounded-lg border border-glass-border bg-background/55 px-3 text-right text-xs text-foreground focus:border-primary/40 focus:outline-none" /> {unit}
); } export function NotificationsSection({ draft, onChange }: NotificationsSectionProps) { return (
{[ { label: "System alerts", description: "CPU overload, high temperature, low disk space", key: "systemAlertsEnabled" as const, }, { label: "Update notifications", description: "Homeio update availability in the desktop alert center", key: "updateNotificationsEnabled" as const, }, { label: "Backup reports", description: "Backup success and failure notifications", key: "backupReportsEnabled" as const, }, ].map(({ label, description, key }) => (
onChange({ [key]: !draft[key] })} />
))}
undefined} disabled disabledReason="Coming soon" />
onChange({ cpuAlertThresholdPercent: v })} /> onChange({ memoryAlertThresholdPercent: v })} /> onChange({ diskAlertThresholdPercent: v })} /> onChange({ temperatureAlertThresholdCelsius: v })} />
); }