| 1 | 'use client' |
| 2 | |
| 3 | import type { VariantProps } from 'class-variance-authority' |
| 4 | import * as LabelPrimitive from '@radix-ui/react-label' |
| 5 | import { cva } from 'class-variance-authority' |
| 6 | import * as React from 'react' |
| 7 | |
| 8 | import { cn } from '@/utils/className' |
| 9 | |
| 10 | const labelVariants = cva( |
| 11 | 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70', |
| 12 | ) |
| 13 | |
| 14 | const Label = React.forwardRef< |
| 15 | React.ElementRef<typeof LabelPrimitive.Root>, |
| 16 | React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants> |
| 17 | >(({ className, ...props }, ref) => ( |
| 18 | <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} /> |
| 19 | )) |
| 20 | Label.displayName = LabelPrimitive.Root.displayName |
| 21 | |
| 22 | export { Label } |
| 23 |