gitscope
← marzneshin / v0.7.2 / dashboard/src/modules/hosts/dialogs/mutation/fields/port.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/hosts/dialogs/mutation/fields/port.tsx · TypeScript
Blame Raw
 1import {
 2    FormControl,
 3    FormField,
 4    FormItem,
 5    FormLabel,
 6    FormMessage,
 7    Input
 8} from "@marzneshin/common/components";
 9import { useFormContext } from "react-hook-form";
10import { useTranslation } from "react-i18next";
11
12export const PortField = () => {
13    const { t } = useTranslation()
14    const form = useFormContext()
15    return (
16        <FormField
17            control={form.control}
18            name="port"
19            render={({ field }) => (
20                <FormItem className="w-1/3">
21                    <FormLabel>{t('port')}</FormLabel>
22                    <FormControl>
23                        <Input type="number" {...field} />
24                    </FormControl>
25                    <FormMessage />
26                </FormItem>
27            )}
28        />
29    )
30}