mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-14 08:15:27 +00:00
21 lines
393 B
TypeScript
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)
|
|
}
|