gitscope
← marzneshin / v0.6.3 / dashboard/src/modules/hosts/dialogs/mutation/fields/allowed-ips.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/hosts/dialogs/mutation/fields/allowed-ips.tsx · TypeScript
Blame Raw
 1import {
 2    FormControl,
 3    FormField,
 4    FormItem,
 5    Textarea,
 6    FormLabel,
 7    FormMessage,
 8} from "@marzneshin/common/components";
 9import { FC } from "react";
10import { useFormContext } from "react-hook-form";
11import { useTranslation } from "react-i18next";
12
13interface AllowedIpsFieldProps { }
14
15export const AllowedIpsField: FC<AllowedIpsFieldProps> = () => {
16    const { t } = useTranslation();
17    const form = useFormContext();
18    return (
19        <FormField
20            control={form.control}
21            name="allowed_ips"
22            render={({ field }) => (
23                <FormItem>
24                    <FormLabel>{t("page.hosts.allowed-ips")}</FormLabel>
25                    <FormControl>
26                        <Textarea
27                            placeholder={t("page.hosts.allowed-ips-placeholder")}
28                            className="resize-none"
29                            {...field}
30                        />
31                    </FormControl>
32                    <FormMessage />
33                </FormItem>
34            )}
35        />
36    );
37};