MCPcopy Create free account
hub / github.com/Codehagen/Badget / ThemeToggle

Function ThemeToggle

src/components/theme-toggle.tsx:8–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import { Button } from "@/components/ui/button";
7
8export function ThemeToggle() {
9 const { theme, setTheme } = useTheme();
10
11 return (
12 <Button
13 variant="outline"
14 size="icon"
15 onClick={() => setTheme(theme === "light" ? "dark" : "light")}
16 className="cursor-pointer rounded-full h-8 w-8"
17 >
18 <Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0 text-primary" />
19 <Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100 text-primary" />
20 <span className="sr-only">Toggle theme</span>
21 </Button>
22 );
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected