import { useOutletContext } from "react-router-dom"; import { Icon } from "../../icon"; import type { UserConfig, UserConfigUpdate } from "../../../api/settings"; type SettingsOutletContext = { config: UserConfig; handleChange: ( key: keyof UserConfigUpdate, value: string | string[] | null, ) => void; handleSave: () => Promise; saveStatus: "idle" | "saving" | "saved" | "error"; }; const THEME_OPTIONS = [ { value: "system", label: "System" }, { value: "light", label: "Light" }, { value: "dark", label: "Dark" }, ]; const TOAST_LEVEL_OPTIONS = [ { value: "all", label: "All" }, { value: "errors", label: "Errors only" }, { value: "none", label: "None" }, ]; const MUTE_CATEGORIES = ["instance", "system", "health", "security"]; export const GeneralSettingsTab = () => { const { config, handleChange, handleSave, saveStatus } = useOutletContext(); return (

General

Notifications

Mute categories
{MUTE_CATEGORIES.map((cat) => ( ))}
{saveStatus === "saved" && ( Settings saved! )} {saveStatus === "error" && ( Failed to save )}
); };