import { useQuery } from "@tanstack/react-query"; import { FormProvider, type UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { Card, CardContent } from "@/components/ui/card"; import { FormControl, FormField, FormFieldItem, FormFieldLabel, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { TabsContent } from "@/components/ui/tabs"; import { env } from "@/config"; import type { MemShellFormSchema } from "@/types/schema"; import { OptionalClassFormField } from "./classname-field"; import { ShellTypeFormField } from "./shelltype-field"; import { UrlPatternFormField } from "./urlpattern-field"; export function CommandTabContent({ form, shellTypes, }: Readonly<{ form: UseFormReturn; shellTypes: Array; }>) { const { t } = useTranslation(["memshell", "common"]); const { data } = useQuery<{ encryptors: Array; implementationClasses: Array; }>({ queryKey: ["commandConfigs"], queryFn: async () => { const response = await fetch(`${env.API_URL}/api/config/command/configs`); return await response.json(); }, }); return (
( {t("common:paramName")} {t("common:optional")} )} />
( {t("common:encryptor")} )} /> ( {t("common:implementationClass")} )} />
); }