Files
shadcn-ui/apps/www/hooks/use-config.ts
shadcn 2f869a2590 feat(www): code blocks package manager (#6075)
* feat(www): code blocks

* fix: code style
2024-12-14 19:13:06 +04:00

24 lines
526 B
TypeScript

import { useAtom } from "jotai"
import { atomWithStorage } from "jotai/utils"
import { BaseColor } from "@/registry/registry-base-colors"
import { Style } from "@/registry/registry-styles"
type Config = {
style: Style["name"]
theme: BaseColor["name"]
radius: number
packageManager: "npm" | "yarn" | "pnpm" | "bun"
}
const configAtom = atomWithStorage<Config>("config", {
style: "new-york",
theme: "zinc",
radius: 0.5,
packageManager: "pnpm",
})
export function useConfig() {
return useAtom(configAtom)
}