hp-prod-tracker/src/components/layout/theme-toggle.tsx
Leivur R. Djurhuus afa98282ff Add app shell layout with sidebar, topbar, breadcrumbs, theme toggle
- Collapsible sidebar (256px / 64px) with nav items and tooltips
- Topbar with breadcrumbs and notification bell placeholder
- Theme toggle (light/dark/system) via dropdown
- Zustand store for sidebar collapsed state
- Placeholder pages for all main routes (dashboard, projects,
  my-work, notifications, settings)
- Authenticated (app) layout group wrapping all protected routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:09:07 -06:00

41 lines
1.3 KiB
TypeScript

"use client";
import { Moon, Sun, Monitor } from "lucide-react";
import { useTheme } from "next-themes";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
export function ThemeToggle() {
const { setTheme, theme } = useTheme();
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon" className="h-8 w-8">
<Sun className="h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
<Sun className="mr-2 h-4 w-4" />
Light
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
<Moon className="mr-2 h-4 w-4" />
Dark
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
<Monitor className="mr-2 h-4 w-4" />
System
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}