https://dev.kronoz.win/r/marzneshin.git
1import {
2 FormControl,
3 FormField,
4 FormItem,
5 FormLabel,
6 FormMessage,
7 Input
8} from "@marzneshin/components";
9import { useFormContext } from "react-hook-form";
10import { useTranslation } from "react-i18next";
11
12export const WeightField = () => {
13 const { t } = useTranslation()
14 const form = useFormContext()
15 return (
16 <FormField
17 control={form.control}
18 name="weight"
19 render={({ field }) => (
20 <FormItem className="w-1/3">
21 <FormLabel>{t('weight')}</FormLabel>
22 <FormControl>
23 <Input type="number" {...field} />
24 </FormControl>
25 <FormMessage />
26 </FormItem>
27 )}
28 />
29 )
30}