import { IconCheck } from "@tabler/icons-react"; import { APPEARANCE_PRESETS, applyAppearance, useAppearance, type AppearancePresetId, } from "./appearance.js"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./components/ui/tooltip.js"; import { cn } from "./utils.js"; export interface AppearancePickerProps { className?: string; /** * Called after a preset is applied (e.g. to persist server-side via * the `change-appearance` action so the choice survives across devices). */ onChange?: (preset: AppearancePresetId) => void; } export function AppearancePicker({ className, onChange, }: AppearancePickerProps) { const current = useAppearance(); return (
{APPEARANCE_PRESETS.map((preset) => { const active = current === preset.id; return ( {preset.label} ); })}
); }