Files
nexus-hub/ lib/client/storage.ts
2025-03-20 18:06:22 +08:00

17 lines
383 B
TypeScript

// lib/client/storage.ts
export const CLIENT_STORAGE_KEYS = {
THEME: "theme",
LANG: "lang"
} as const;
export const getInitialState = () => {
if (typeof window === "undefined") return {};
return {
uiStore: {
theme: localStorage.getItem(CLIENT_STORAGE_KEYS.THEME) || "light",
language: localStorage.getItem(CLIENT_STORAGE_KEYS.LANG) || "zh-CN"
}
};
};