Files
gregorlohaus.com/src/app/_components/TextInputFormField.tsx

18 lines
673 B
TypeScript

import type { Control, FieldValues, Path } from "react-hook-form";
import { FormField, FormItem, FormLabel } from "~/components/ui/form";
import { Input } from "~/components/ui/input";
export default function TexttInputFormField<T extends FieldValues>(params: { control: Control<T>, name: Path<T>, label:string }) {
return (
<FormField
control={params.control}
name={params.name}
render={({ field }) => (
<FormItem className="flex flex-col">
<FormLabel>{params.label}</FormLabel>
<Input placeholder="release link" onChange={field.onChange} value={field.value == null ? undefined : field.value} />
</FormItem>
)}
/>
)
}