diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-13 22:37:41 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-03-14 16:40:45 +0000 |
| commit | a03f1dc2ac25579df30e8cb59d2703110c3e564d (patch) | |
| tree | 59315e73cd83dc391660071c70752cf23989b3da /apps/web/components/ui/form.tsx | |
| parent | 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 (diff) | |
| download | karakeep-a03f1dc2ac25579df30e8cb59d2703110c3e564d.tar.zst | |
lint: Lint and format the entire repo with the new configs
Diffstat (limited to 'apps/web/components/ui/form.tsx')
| -rw-r--r-- | apps/web/components/ui/form.tsx | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/apps/web/components/ui/form.tsx b/apps/web/components/ui/form.tsx index e62e10e9..20ce3c4b 100644 --- a/apps/web/components/ui/form.tsx +++ b/apps/web/components/ui/form.tsx @@ -1,26 +1,19 @@ +import type * as LabelPrimitive from "@radix-ui/react-label"; +import type { ControllerProps, FieldPath, FieldValues } from "react-hook-form"; import * as React from "react"; -import * as LabelPrimitive from "@radix-ui/react-label"; -import { Slot } from "@radix-ui/react-slot"; -import { - Controller, - ControllerProps, - FieldPath, - FieldValues, - FormProvider, - useFormContext, -} from "react-hook-form"; - -import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; +import { cn } from "@/lib/utils"; +import { Slot } from "@radix-ui/react-slot"; +import { Controller, FormProvider, useFormContext } from "react-hook-form"; const Form = FormProvider; -type FormFieldContextValue< +interface FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, -> = { +> { name: TName; -}; +} const FormFieldContext = React.createContext<FormFieldContextValue>( {} as FormFieldContextValue, @@ -62,9 +55,9 @@ const useFormField = () => { }; }; -type FormItemContextValue = { +interface FormItemContextValue { id: string; -}; +} const FormItemContext = React.createContext<FormItemContextValue>( {} as FormItemContextValue, @@ -134,7 +127,7 @@ const FormDescription = React.forwardRef< <p ref={ref} id={formDescriptionId} - className={cn("text-muted-foreground text-sm", className)} + className={cn("text-sm text-muted-foreground", className)} {...props} /> ); @@ -156,7 +149,7 @@ const FormMessage = React.forwardRef< <p ref={ref} id={formMessageId} - className={cn("text-destructive text-sm font-medium", className)} + className={cn("text-sm font-medium text-destructive", className)} {...props} > {body} |
