import { useSettings } from "@/store/settings"; import { Switch } from "@/ui/misc"; import { browserTimeZone, listTimeZones } from "@/lib/dates"; import { toast } from "@/ui/toast"; import { browserLocale, formatClock, formatDate, formatFullDateTime, getServerLocale, localeLabel, localeOptions, withPrefs, type DateFormat, } from "@/lib/datetime"; /** Illustrative instant used for the format previews: 22 Nov 2025, 18:23. */ const SAMPLE = new Date(2025, 10, 22, 18, 23); const DATE_FORMATS: Array<{ value: DateFormat; label: string }> = [ { value: "auto", label: "Automatic" }, { value: "dmy-dot", label: "Day.Month.Year" }, { value: "dmy-slash", label: "Day/Month/Year" }, { value: "mdy-slash", label: "Month/Day/Year" }, { value: "ymd-dash", label: "Year-Month-Day (ISO 8601)" }, ]; export function GeneralSettings() { const s = useSettings((st) => st.settings); const update = useSettings((st) => st.update); const reset = useSettings((st) => st.reset); const exportJson = useSettings((st) => st.exportJson); const importJson = useSettings((st) => st.importJson); const serverLocale = getServerLocale(); const autoLocale = serverLocale ?? browserLocale(); return (

General

Reading, sending and list behaviour. Settings are stored in this browser.

Reading

update({ conversationMode: v })} label="Conversation view" hint="Group messages from the same thread together." /> update({ showPreview: v })} label="Show message snippets" hint="Preview the first line of each message in the list." /> update({ showAvatars: v })} label="Show sender avatars" /> update({ confirmDelete: v })} label="Confirm before deleting" />

Composing

update({ includeQuote: v })} label="Quote original message in replies" /> update({ signatureAboveQuote: v })} label="Place signature above quoted text" /> update({ attachmentReminder: v })} label="Attachment reminder" hint="Warn when the message mentions an attachment but none is attached." /> update({ requestReadReceipt: v })} label="Always request read receipts" /> update({ spellcheck: v })} label="Spell check while typing" />

Locale

{serverLocale ? `Your mail server reports ${localeLabel(serverLocale)} (${serverLocale}).` : "Your mail server does not report a locale, so the browser's is used."} Dates, times and month names follow this choice.

Preview: {formatFullDateTime(SAMPLE)}

Backup

); }