← marzneshin
/
v0.4.1
/
dashboard/src/features/users/components/dialogs/mutation/fields/data-limit.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/users/components/dialogs/mutation/fields/data-limit.tsx
· TypeScript
Blame
Raw
1import {
2 FormControl,
3 FormField,
4 FormItem,
5 Input,
6 FormLabel,
7 FormMessage
8} from '@marzneshin/components';
9import { FC } from 'react'
10import { useFormContext } from 'react-hook-form';
11import { useTranslation } from 'react-i18next';
12
13interface DataLimitFieldProps { }
14
15export const DataLimitField: FC<DataLimitFieldProps> = () => {
16 const { t } = useTranslation()
17 const form = useFormContext()
18 return (
19 <FormField
20 control={form.control}
21 name="data_limit"
22 render={({ field }) => (
23 <FormItem className="w-full">
24 <FormLabel>{t('page.users.traffic')}</FormLabel>
25 <FormControl>
26 <Input
27 type="number"
28 className="order-1"
29 {...field}
30 placeholder="GB"
31 />
32 </FormControl>
33 <FormMessage />
34 </FormItem>
35 )}
36 />
37 );
38}