gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/subscription-settings/form/fields/placeholder-remark.tsx · v0.4.0
Source
1 fb4b69d Dawsh 2y ago import {
2 fb4b69d Dawsh 2y ago FormField,
3 fb4b69d Dawsh 2y ago FormItem,
4 fb4b69d Dawsh 2y ago FormLabel,
5 fb4b69d Dawsh 2y ago Input,
6 fb4b69d Dawsh 2y ago FormControl,
7 fb4b69d Dawsh 2y ago Popover,
8 fb4b69d Dawsh 2y ago PopoverTrigger,
9 fb4b69d Dawsh 2y ago PopoverContent,
10 fb4b69d Dawsh 2y ago } from "@marzneshin/components";
11 fb4b69d Dawsh 2y ago import { PopoverGuide } from "@marzneshin/features/hosts";
12 fb4b69d Dawsh 2y ago import { InfoIcon } from 'lucide-react';
13 fb4b69d Dawsh 2y ago import { useFormContext } from "react-hook-form";
14 fb4b69d Dawsh 2y ago import { useTranslation } from "react-i18next";
15 fb4b69d Dawsh 2y ago
16 fb4b69d Dawsh 2y ago export const PlaceholderRemarkField = () => {
17 fb4b69d Dawsh 2y ago const { t } = useTranslation()
18 fb4b69d Dawsh 2y ago const form = useFormContext();
19 fb4b69d Dawsh 2y ago return (
20 fb4b69d Dawsh 2y ago <FormField
21 fb4b69d Dawsh 2y ago control={form.control}
22 fb4b69d Dawsh 2y ago name="placeholder_remark"
23 fb4b69d Dawsh 2y ago render={({ field }) => (
24 fb4b69d Dawsh 2y ago <FormItem>
25 fb4b69d Dawsh 2y ago <FormLabel className="flex flex-row items-center gap-2">
26 fb4b69d Dawsh 2y ago {t("page.settings.subscription-settings.placeholder-remark")}
27 fb4b69d Dawsh 2y ago <Popover>
28 fb4b69d Dawsh 2y ago <PopoverTrigger>
29 fb4b69d Dawsh 2y ago <InfoIcon className="size-5" />
30 fb4b69d Dawsh 2y ago </PopoverTrigger>
31 fb4b69d Dawsh 2y ago <PopoverContent className="w-80">
32 fb4b69d Dawsh 2y ago <PopoverGuide />
33 fb4b69d Dawsh 2y ago </PopoverContent>
34 fb4b69d Dawsh 2y ago </Popover>
35 fb4b69d Dawsh 2y ago </FormLabel>
36 fb4b69d Dawsh 2y ago <FormControl>
37 fb4b69d Dawsh 2y ago <Input className="h-8" {...field} />
38 fb4b69d Dawsh 2y ago </FormControl>
39 fb4b69d Dawsh 2y ago </FormItem>
40 fb4b69d Dawsh 2y ago )}
41 fb4b69d Dawsh 2y ago />
42 fb4b69d Dawsh 2y ago )
43 fb4b69d Dawsh 2y ago }