dumb refactor but sunk cost is to great keep pushing
This commit is contained in:
17
src/app/_components/TextInputFormField.tsx
Normal file
17
src/app/_components/TextInputFormField.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
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>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user