import { lazy, Suspense, type ReactNode } from "react"; import { Link, useLocation } from "wouter"; import { ArrowLeft, Bell, EyeOff, Filter, Folder, Info, Keyboard, LayoutTemplate, Palette, PenLine, Plane, Settings as SettingsIcon, ShieldCheck, Tag, Users, Calendar } from "lucide-react"; import { Spinner } from "@/ui/misc"; import { GeneralSettings } from "./GeneralSettings"; import { AppearanceSettings } from "./AppearanceSettings"; import { IdentitiesSettings } from "./IdentitiesSettings"; import { FoldersSettings } from "./FoldersSettings"; import { LabelsSettings } from "./LabelsSettings"; import { TemplatesSettings } from "./TemplatesSettings"; import { NotificationsSettings } from "./NotificationsSettings"; import { PrivacySettings } from "./PrivacySettings"; import { SecuritySettings } from "./SecuritySettings"; import { AboutSettings } from "./AboutSettings"; import { ShortcutsSettings } from "./ShortcutsSettings"; import { CalendarSettings } from "./CalendarSettings"; import { t } from "@/lib/i18n"; const FiltersSettings = lazy(() => import("./FiltersSettings").then((m) => ({ default: m.FiltersSettings }))); const VacationSettings = lazy(() => import("./VacationSettings").then((m) => ({ default: m.VacationSettings }))); const SECTIONS: Array<{ id: string; label: string; icon: ReactNode; el: ReactNode }> = [ { id: "general", label: "General", icon: , el: }, { id: "appearance", label: "Appearance", icon: , el: }, { id: "identities", label: "Identities & signatures", icon: , el: }, { id: "filters", label: "Filters & rules", icon: , el: }, { id: "vacation", label: "Out of office", icon: , el: }, { id: "folders", label: "Folders", icon: , el: }, { id: "labels", label: "Labels", icon: , el: }, { id: "templates", label: "Templates", icon: , el: }, { id: "calendar", label: "Calendar & contacts", icon: , el: }, { id: "notifications", label: "Notifications", icon: , el: }, { id: "privacy", label: "Privacy & safety", icon: , el: }, { id: "security", label: "Security & sessions", icon: , el: }, { id: "shortcuts", label: "Keyboard shortcuts", icon: , el: }, { id: "about", label: "About", icon: , el: }, ]; export function SettingsView({ section }: { section?: string }) { const [, navigate] = useLocation(); const current = SECTIONS.find((s) => s.id === section); return (
{section && ( )} }>{current ? current.el : }
); }