gitscope
← marzneshin / v0.1.0 / app/dashboard/src/pages/users/dialog/note-field.tsx
https://dev.kronoz.win/r/marzneshin.git
app/dashboard/src/pages/users/dialog/note-field.tsx · TypeScript
Blame Raw
 1import { FormControl, FormLabel, Textarea, FormErrorMessage } from '@chakra-ui/react';
 2import { TFunction } from 'i18next';
 3
 4interface NoteFieldProps {
 5    form: any;
 6    t: TFunction<'translation', undefined, 'translation'>;
 7}
 8
 9export const NoteField = ({ t, form }: NoteFieldProps) => {
10  return (
11    <FormControl
12      mb={'10px'}
13      isInvalid={!!form.formState.errors.note}
14    >
15      <FormLabel>{t('userDialog.note')}</FormLabel>
16      <Textarea {...form.register('note')} />
17      <FormErrorMessage>
18        {form.formState.errors?.note?.message}
19      </FormErrorMessage>
20    </FormControl>
21  )
22}