Files
Frontend/src/app/components/ui/label.tsx

20 lines
714 B
TypeScript
Raw Normal View History

2024-04-19 15:22:03 +01:00
"use client";
2024-04-19 15:22:03 +01:00
import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
import { cva, type VariantProps } from "class-variance-authority";
2024-04-19 15:22:03 +01:00
import { cn } from "@/common/utils";
2024-04-19 15:22:03 +01:00
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
2024-04-19 15:22:03 +01:00
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
>(({ className, ...props }, ref) => (
2024-04-19 15:22:03 +01:00
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
));
Label.displayName = LabelPrimitive.Root.displayName;
2024-04-19 15:22:03 +01:00
export { Label };