'use client' import { cn } from '@/lib/utils' import { useAtom } from 'jotai' import { CheckSquare, ListChecks } from 'lucide-react' import { transientSettingsAtom } from '@/lib/atoms' import type { ViewType } from '@/lib/types' interface ViewToggleProps { defaultView?: ViewType className?: string } export function ViewToggle({ defaultView = 'habits', className }: ViewToggleProps) { const [transientSettings, setTransientSettings] = useAtom(transientSettingsAtom) const handleViewChange = (checked: boolean) => { const newView = checked ? 'tasks' : 'habits' setTransientSettings({ ...transientSettings, viewType: newView, }) } return (