https://dev.kronoz.win/r/marzneshin.git
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 PathField = ({ label }: { label?: string }) => {
13 const { t } = useTranslation();
14 const form = useFormContext();
15 return (
16 <FormField
17 control={form.control}
18 name="path"
19 render={({ field }) => (
20 <FormItem className="w-full">
21 <FormLabel>{label ?? t("path")}</FormLabel>
22 <FormControl>
23 <Input {...field} />
24 </FormControl>
25 <FormMessage />
26 </FormItem>
27 )}
28 />
29 );
30};