Spaces:
Running
Running
Download src/components/ui/switch.tsx from evalstate/mcp-webcam: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/evalstate/mcp-webcam/resolve/main/src/components/ui/switch.tsx
- Command line
-
hf download hf://spaces/evalstate/mcp-webcam/src/components/ui/switch.tsx
-
curl -L -o switch.tsx https://huggingface.co/spaces/evalstate/mcp-webcam/resolve/main/src/components/ui/switch.tsx
1.1 kB
| import * as React from 'react'; | |
| import * as SwitchPrimitive from '@radix-ui/react-switch'; | |
| import { cn } from '@/lib/utils'; | |
| export const Switch = React.forwardRef< | |
| React.ComponentRef<typeof SwitchPrimitive.Root>, | |
| React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> | |
| >(({ className, ...props }, ref) => ( | |
| <SwitchPrimitive.Root | |
| ref={ref} | |
| className={cn( | |
| 'peer inline-flex h-4.5 w-8 shrink-0 cursor-pointer items-center rounded-full border border-line bg-panel-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-push/50 disabled:cursor-not-allowed disabled:opacity-45 data-[state=checked]:border-push/50 data-[state=checked]:bg-push/85', | |
| className, | |
| )} | |
| {...props} | |
| > | |
| <SwitchPrimitive.Thumb | |
| className={cn( | |
| 'pointer-events-none block h-3.5 w-3.5 rounded-full bg-fg shadow-xs transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0.5 data-[state=checked]:bg-zinc-950', | |
| )} | |
| /> | |
| </SwitchPrimitive.Root> | |
| )); | |
| Switch.displayName = SwitchPrimitive.Root.displayName; | |