feat: support probe shell generation

This commit is contained in:
ReaJason
2025-08-13 23:53:40 +08:00
parent 6a4c5a1e96
commit 13be57e66d
304 changed files with 59084 additions and 1454 deletions
@@ -0,0 +1,26 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { FormField, FormFieldItem, FormFieldLabel, FormMessage } from "@/components/ui/form.tsx";
import { Input } from "@/components/ui/input.tsx";
import { shouldHidden } from "@/lib/utils";
import type { ShellFormSchema } from "@/types/schema.ts";
export function UrlPatternFormField({ form }: Readonly<{ form: UseFormReturn<ShellFormSchema> }>) {
const { t } = useTranslation();
const shellType = form.watch("shellType");
return (
<FormProvider {...form}>
<FormField
control={form.control}
name="urlPattern"
render={({ field }) => (
<FormFieldItem className={shouldHidden(shellType) ? "hidden" : "grid"}>
<FormFieldLabel>{t("mainConfig.urlPattern")}</FormFieldLabel>
<Input {...field} placeholder={t("placeholders.input")} />
<FormMessage />
</FormFieldItem>
)}
/>
</FormProvider>
);
}