import { FormControl, FormField, FormItem, FormLabel, FormMessage, FormDescription } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { UseFormReturn } from "react-hook-form"; import { ServiceFormData } from "./types"; import { ServiceUrlField } from "./ServiceUrlField"; import { useState } from "react"; import {useLanguage} from "@/contexts/LanguageContext.tsx"; interface ServiceConfigFieldsProps { form: UseFormReturn; } export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) { const { t } = useLanguage(); const [isCustomInterval, setIsCustomInterval] = useState(false); const intervalValue = form.watch("interval"); const handleIntervalChange = (value: string) => { if (value === "custom") { setIsCustomInterval(true); form.setValue("interval", ""); } else { setIsCustomInterval(false); form.setValue("interval", value); } }; return (
( {t("checkInterval")} {!isCustomInterval ? ( ) : (
)} {isCustomInterval ? t("checkIntervalDescCustom") : t("checkIntervalDesc") }
)} /> ( {t("retryAttempts")} {t("retryAttemptsDesc")} )} />
); }