import { useTranslate } from '@/hooks/common-hooks'; import { Form, Input, Select } from 'antd'; import { useMemo } from 'react'; import { QWeatherLangOptions, QWeatherTimePeriodOptions, QWeatherTypeOptions, QWeatherUserTypeOptions, } from '../constant'; import { IOperatorForm } from '../interface'; const QWeatherForm = ({ onValuesChange, form }: IOperatorForm) => { const { t } = useTranslate('flow'); const qWeatherLangOptions = useMemo(() => { return QWeatherLangOptions.map((x) => ({ value: x, label: t(`qWeatherLangOptions.${x}`), })); }, [t]); const qWeatherTypeOptions = useMemo(() => { return QWeatherTypeOptions.map((x) => ({ value: x, label: t(`qWeatherTypeOptions.${x}`), })); }, [t]); const qWeatherUserTypeOptions = useMemo(() => { return QWeatherUserTypeOptions.map((x) => ({ value: x, label: t(`qWeatherUserTypeOptions.${x}`), })); }, [t]); const qWeatherTimePeriodOptions = useMemo(() => { return QWeatherTimePeriodOptions.map((x) => ({ value: x, label: t(`qWeatherTimePeriodOptions.${x}`), })); }, [t]); return (
{({ getFieldValue }) => getFieldValue('type') === 'weather' && ( ) }
); }; export default QWeatherForm;