The weeb for the next gen discord boat - Wamellow
wamellow.com
bot
discord
1"use client";
2
3import { cn } from "@/utils/cn";
4import * as SwitchPrimitives from "@radix-ui/react-switch";
5import * as React from "react";
6
7const Switch = React.forwardRef<
8 React.ElementRef<typeof SwitchPrimitives.Root>,
9 React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
10>(({ className, ...props }, ref) => (
11 <SwitchPrimitives.Root
12 className={cn(
13 "peer inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-secondary data-[state=unchecked]:bg-muted",
14 className
15 )}
16 {...props}
17 ref={ref}
18 >
19 <SwitchPrimitives.Thumb
20 className={cn(
21 "pointer-events-none block size-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-[22px] data-[state=unchecked]:translate-x-0.5"
22 )}
23 />
24 </SwitchPrimitives.Root>
25));
26Switch.displayName = SwitchPrimitives.Root.displayName;
27
28export { Switch };