← marzneshin
/
v0.3.1
/
dashboard/src/features/subscription-settings/form/fields/placeholder-if-disabled.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/subscription-settings/form/fields/placeholder-if-disabled.tsx
· TypeScript
Blame
Raw
1import {
2 FormField,
3 FormItem,
4 FormLabel,
5 Checkbox,
6 FormControl,
7} from "@marzneshin/components";
8import { useFormContext } from "react-hook-form";
9import { useTranslation } from "react-i18next";
10
11export const PlaceholderIfDisabledField = () => {
12 const { t } = useTranslation()
13 const form = useFormContext();
14 return (
15 <FormField
16 control={form.control}
17 name="placeholder_if_disabled"
18 render={({ field }) => (
19 <FormItem className="flex flex-row items-start space-x-3 space-y-0 rounded-md py-2">
20 <FormControl>
21 <Checkbox
22 checked={field.value}
23 onCheckedChange={field.onChange}
24 />
25 </FormControl>
26 <div className="space-y-1 leading-none">
27 <FormLabel>
28 {t("page.settings.subscription-settings.placeholder-if-disabled")}
29 </FormLabel>
30 </div>
31 </FormItem>
32 )}
33 />
34 )
35}