Files
gameyfin/frontend/@/hooks/useConfig.ts
T
2024-03-27 18:26:47 +01:00

21 lines
393 B
TypeScript

import {useAtom} from "jotai"
import {atomWithStorage} from "jotai/utils"
import {Theme} from "Frontend/@/registry/themes"
type Config = {
theme: Theme["name"]
mode: "light" | "dark",
radius: number
}
const configAtom = atomWithStorage<Config>("config", {
theme: "zinc",
mode: "light",
radius: 0.5,
})
export function useConfig() {
return useAtom(configAtom)
}