Spaces:
Running
Running
Download src/components/layout/ThemeToggle.tsx from evalstate/mcp-webcam: direct link, hf CLI and curl.
- Browser
- Download file 812 Bytes
-
https://huggingface.co/spaces/evalstate/mcp-webcam/resolve/main/src/components/layout/ThemeToggle.tsx
- Command line
-
hf download hf://spaces/evalstate/mcp-webcam/src/components/layout/ThemeToggle.tsx
-
curl -L -o ThemeToggle.tsx https://huggingface.co/spaces/evalstate/mcp-webcam/resolve/main/src/components/layout/ThemeToggle.tsx
812 Bytes
| import { Moon, Sun } from 'lucide-react'; | |
| import { Button } from '@/components/ui/button'; | |
| import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; | |
| import type { Theme } from '@/lib/theme'; | |
| export function ThemeToggle({ theme, onToggle }: { theme: Theme; onToggle: () => void }) { | |
| return ( | |
| <Tooltip> | |
| <TooltipTrigger asChild> | |
| <Button | |
| variant="ghost" | |
| size="icon-sm" | |
| onClick={onToggle} | |
| aria-label={theme === 'dark' ? 'Switch to light theme' : 'Switch to dark theme'} | |
| > | |
| {theme === 'dark' ? <Sun className="h-3.5 w-3.5" /> : <Moon className="h-3.5 w-3.5" />} | |
| </Button> | |
| </TooltipTrigger> | |
| <TooltipContent>{theme === 'dark' ? 'Light theme' : 'Dark theme'}</TooltipContent> | |
| </Tooltip> | |
| ); | |
| } | |