mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-08 03:28:51 +01:00
feat: add react-hook-form dependency and update FormInput component to use its types
This commit is contained in:
parent
63d0c301a0
commit
55f67212d5
3 changed files with 25 additions and 2 deletions
|
|
@ -1,9 +1,13 @@
|
|||
import React from 'react';
|
||||
import type { ControllerRenderProps, FieldValues, FieldPath } from 'react-hook-form';
|
||||
import { Label } from './Label';
|
||||
import { Input } from './Input';
|
||||
import { cn } from '~/utils';
|
||||
|
||||
export default function FormInput({
|
||||
export default function FormInput<
|
||||
TFieldValues extends FieldValues = FieldValues,
|
||||
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
||||
>({
|
||||
field,
|
||||
label,
|
||||
labelClass,
|
||||
|
|
@ -13,7 +17,7 @@ export default function FormInput({
|
|||
placeholder = '',
|
||||
type = 'string',
|
||||
}: {
|
||||
field: any;
|
||||
field: ControllerRenderProps<TFieldValues, TName>;
|
||||
label: string;
|
||||
labelClass?: string;
|
||||
inputClass?: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue