← marzneshin
/
v0.5.2
/
dashboard/src/features/subscription-settings/form/fields/update-interval.tsx
https://dev.kronoz.win/r/marzneshin.git
1import {
2 FormField,
3 FormItem,
4 FormLabel,
5 Input,
6 FormControl,
7} from "@marzneshin/components";
8import { useFormContext } from "react-hook-form";
9import { useTranslation } from "react-i18next";
10
11export const UpdateIntervalField = () => {
12 const { t } = useTranslation()
13 const form = useFormContext();
14 return (
15 <FormField
16 control={form.control}
17 name="update_interval"
18 render={({ field }) => (
19 <FormItem>
20 <FormLabel>{t("page.settings.subscription-settings.update-interval")}</FormLabel>
21 <FormControl>
22 <Input
23 className="h-8"
24 type="number"
25 {...field}
26 {...form.register('update_interval', { valueAsNumber: true })}
27 />
28 </FormControl>
29 </FormItem>
30 )}
31 />
32 )
33}