← marzneshin
/
v0.7.4
/
dashboard/src/modules/admins/components/dialogs/mutation/fields/sudo-privilage.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/admins/components/dialogs/mutation/fields/sudo-privilage.tsx
· TypeScript
Blame
Raw
1import {
2 FormField,
3 FormItem,
4 FormLabel,
5 Checkbox,
6 FormControl,
7} from "@marzneshin/common/components";
8import { useFormContext } from "react-hook-form";
9import { useTranslation } from "react-i18next";
10
11export const SudoPrivilageField = () => {
12 const { t } = useTranslation()
13 const form = useFormContext();
14 return (
15 <FormField
16 control={form.control}
17 name="is_sudo"
18 render={({ field }) => (
19 <FormItem className="flex flex-row items-start space-x-3 space-y-0 rounded-md">
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.admins.sudo-privilage")}
29 </FormLabel>
30 </div>
31 </FormItem>
32 )}
33 />
34 )
35}