File size: 761 Bytes
93ad82e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import { ComponentProps } from "react"
import { Label } from "@/components/ui/label"
import { cn } from "@/lib/utils/cn"
import { Switch } from "../ui/switch"
export function SwitchField({
label,
className = "",
labelClassName = "",
switchClassName = "",
...props
}: ComponentProps<typeof Switch> & {
label?: string;
className?: string;
labelClassName?: string;
switchClassName?: string;
}) {
return (
<div className={cn(
`flex flex-col space-y-3 items-start`,
className
)}>
{label && <Label className={cn(`
text-base md:text-lg lg:text-xl
text-stone-900/90 dark:text-stone-100/90
`, labelClassName)}>{label}</Label>}
<Switch {...props} className={switchClassName} />
</div>
)
} |