diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-08 03:25:43 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-08 03:25:43 +0000 |
| commit | 333429adbaaa592cc96b480a5228f0e3f1de4cc2 (patch) | |
| tree | 6f22ca5c064c8b6ffa8aeb40a76e055c77c5564e /web/components/ui/label.tsx | |
| parent | 2659da517aeec0fe955422dee76f7de292f1a591 (diff) | |
| download | karakeep-333429adbaaa592cc96b480a5228f0e3f1de4cc2.tar.zst | |
[refactor] Use react form hock for the AddLink
Diffstat (limited to 'web/components/ui/label.tsx')
| -rw-r--r-- | web/components/ui/label.tsx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/web/components/ui/label.tsx b/web/components/ui/label.tsx new file mode 100644 index 00000000..53418217 --- /dev/null +++ b/web/components/ui/label.tsx @@ -0,0 +1,26 @@ +"use client" + +import * as React from "react" +import * as LabelPrimitive from "@radix-ui/react-label" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +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>, + React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & + VariantProps<typeof labelVariants> +>(({ className, ...props }, ref) => ( + <LabelPrimitive.Root + ref={ref} + className={cn(labelVariants(), className)} + {...props} + /> +)) +Label.displayName = LabelPrimitive.Root.displayName + +export { Label } |
