refactor: simplify component

This commit is contained in:
ReaJason
2025-05-28 01:22:54 +08:00
parent f734e3c391
commit e31fcdeca9
18 changed files with 250 additions and 184 deletions
+20 -20
View File
@@ -2,7 +2,7 @@ import { FormSchema } from "@/types/schema";
import { FormProvider, UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "../ui/card";
import { FormField, FormItem, FormLabel } from "../ui/form";
import { FormField, FormFieldItem, FormFieldLabel } from "../ui/form";
import { Input } from "../ui/input";
import { TabsContent } from "../ui/tabs";
import { OptionalClassFormField } from "./classname-field";
@@ -28,46 +28,46 @@ export function GodzillaTabContent({
control={form.control}
name="godzillaPass"
render={({ field }) => (
<FormItem className="gap-1">
<FormLabel className="h-6 flex items-center gap-1">
<FormFieldItem>
<FormFieldLabel>
{t("shellToolConfig.pass")} {t("optional")}
</FormLabel>
<Input {...field} placeholder={t("placeholders.input")} className="h-8" />
</FormItem>
</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
</FormFieldItem>
)}
/>
<FormField
control={form.control}
name="godzillaKey"
render={({ field }) => (
<FormItem className="gap-1">
<FormLabel className="h-6 flex items-center gap-1">
<FormFieldItem>
<FormFieldLabel>
{t("shellToolConfig.key")} {t("optional")}
</FormLabel>
<Input {...field} placeholder={t("placeholders.input")} className="h-8" />
</FormItem>
</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
</FormFieldItem>
)}
/>
<FormField
control={form.control}
name="headerName"
render={({ field }) => (
<FormItem className="gap-1">
<FormLabel className="h-6 flex items-center gap-1">{t("shellToolConfig.headerName")}</FormLabel>
<Input {...field} placeholder={t("placeholders.input")} className="h-8" />
</FormItem>
<FormFieldItem>
<FormFieldLabel>{t("shellToolConfig.headerName")}</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
</FormFieldItem>
)}
/>
<FormField
control={form.control}
name="headerValue"
render={({ field }) => (
<FormItem className="gap-1">
<FormLabel className="h-6 flex items-center gap-1">
<FormFieldItem>
<FormFieldLabel>
{t("shellToolConfig.headerValue")} {t("optional")}
</FormLabel>
<Input {...field} placeholder={t("placeholders.input")} className="h-8" />
</FormItem>
</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
</FormFieldItem>
)}
/>
</div>