mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-02 08:58:36 +00:00
22 lines
419 B
TypeScript
22 lines
419 B
TypeScript
import { useAtom } from "jotai"
|
|
import { atomWithStorage } from "jotai/utils"
|
|
|
|
import { Style } from "@/registry/styles"
|
|
import { Theme } from "@/registry/themes"
|
|
|
|
type Config = {
|
|
style: Style["name"]
|
|
theme: Theme["name"]
|
|
radius: number
|
|
}
|
|
|
|
const configAtom = atomWithStorage<Config>("config", {
|
|
style: "new-york",
|
|
theme: "zinc",
|
|
radius: 0.5,
|
|
})
|
|
|
|
export function useConfig() {
|
|
return useAtom(configAtom)
|
|
}
|