import db from "./db"; export const THEME = { DARK: "dark", LIGHT: "light", SYSTEM: "system", }; // How the date component is displayed. SYSTEM follows the browser's locale (i.e. the OS region/ // format settings, not the chosen UI translation language); ISO8601 forces YYYY-MM-DD; DMY and MDY // force the day/month order regardless of locale (e.g. for an English UI that defaults to US order). export const DATE_FORMAT = { SYSTEM: "system", ISO8601: "iso8601", DMY: "dmy", DMY_DOT: "dmy_dot", MDY: "mdy", }; // How the time component (clock) is displayed. Orthogonal to DATE_FORMAT and to the UI language -- // SYSTEM lets the browser locale decide, H12/H24 force a 12- or 24-hour clock. ISO 8601 dates are // always 24-hour, so this setting is ignored in that mode. export const TIME_FORMAT = { SYSTEM: "system", H12: "12h", H24: "24h", }; // Default values the getters return when a pref is unset; also used by PrefCache (PrefCache.jsx). export const PREF_DEFAULTS = { sound: "ding", minPriority: 1, deleteAfter: 604800, // one week theme: THEME.SYSTEM, dateFormat: DATE_FORMAT.SYSTEM, timeFormat: TIME_FORMAT.SYSTEM, webPushEnabled: false, }; // Guards against values the current build doesn't know about (e.g. a pref synced from a newer // client, or a renamed enum). An unknown value would leave the Settings