chore: format

This commit is contained in:
2025-10-10 16:43:21 +02:00
parent f0aabd63b6
commit 75c29e0ba4
551 changed files with 433948 additions and 94145 deletions

View File

@@ -1,48 +1,48 @@
import { Control, FieldPath, FieldValues } from "react-hook-form"
import type { ComponentProps } from "react"
import { Control, FieldPath, FieldValues } from "react-hook-form";
import type { ComponentProps } from "react";
import {
FormField,
FormItem,
FormLabel,
FormControl,
Input,
FormDescription,
FormMessage,
} from "@repo/ui"
FormField,
FormItem,
FormLabel,
FormControl,
Input,
FormDescription,
FormMessage,
} from "@repo/ui";
interface FormControlledInputProps<
TFieldValues extends FieldValues = FieldValues,
TFieldValues extends FieldValues = FieldValues,
> {
control: Control<TFieldValues>
name: FieldPath<TFieldValues>
label: string
description?: string
inputProps?: ComponentProps<typeof Input>
control: Control<TFieldValues>;
name: FieldPath<TFieldValues>;
label: string;
description?: string;
inputProps?: ComponentProps<typeof Input>;
}
export function FormControlledInput<
TFieldValues extends FieldValues = FieldValues,
TFieldValues extends FieldValues = FieldValues,
>({
control,
name,
label,
description,
inputProps,
control,
name,
label,
description,
inputProps,
}: FormControlledInputProps<TFieldValues>) {
return (
<FormField
control={control}
name={name}
render={({ field }) => (
<FormItem>
<FormLabel>{label}</FormLabel>
<FormControl>
<Input {...inputProps} {...field} />
</FormControl>
{description && <FormDescription>{description}</FormDescription>}
<FormMessage />
</FormItem>
)}
/>
)
return (
<FormField
control={control}
name={name}
render={({ field }) => (
<FormItem>
<FormLabel>{label}</FormLabel>
<FormControl>
<Input {...inputProps} {...field} />
</FormControl>
{description && <FormDescription>{description}</FormDescription>}
<FormMessage />
</FormItem>
)}
/>
);
}