2024-07-12 11:37:31 +08:00
|
|
|
import TopNItem from '@/components/top-n-item';
|
2024-07-17 19:07:34 +08:00
|
|
|
import { useTranslate } from '@/hooks/common-hooks';
|
2024-07-12 15:22:36 +08:00
|
|
|
import { Form, Select } from 'antd';
|
2024-07-15 10:23:16 +08:00
|
|
|
import { useMemo } from 'react';
|
|
|
|
import { Channel } from '../constant';
|
2024-07-12 11:37:31 +08:00
|
|
|
import { IOperatorForm } from '../interface';
|
|
|
|
|
|
|
|
const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|
|
|
const { t } = useTranslate('flow');
|
|
|
|
|
2024-07-15 10:23:16 +08:00
|
|
|
const options = useMemo(() => {
|
|
|
|
return Object.values(Channel).map((x) => ({ value: x, label: t(x) }));
|
|
|
|
}, [t]);
|
|
|
|
|
2024-07-12 11:37:31 +08:00
|
|
|
return (
|
|
|
|
<Form
|
|
|
|
name="basic"
|
|
|
|
labelCol={{ span: 6 }}
|
|
|
|
wrapperCol={{ span: 18 }}
|
|
|
|
autoComplete="off"
|
|
|
|
form={form}
|
|
|
|
onValuesChange={onValuesChange}
|
|
|
|
>
|
2024-07-12 17:22:01 +08:00
|
|
|
<TopNItem initialValue={10}></TopNItem>
|
2024-07-12 11:37:31 +08:00
|
|
|
<Form.Item
|
|
|
|
label={t('channel')}
|
|
|
|
name={'channel'}
|
|
|
|
tooltip={t('channelTip')}
|
2024-07-12 15:22:36 +08:00
|
|
|
initialValue={'text'}
|
2024-07-12 11:37:31 +08:00
|
|
|
>
|
2024-07-15 10:23:16 +08:00
|
|
|
<Select options={options}></Select>
|
2024-07-12 11:37:31 +08:00
|
|
|
</Form.Item>
|
|
|
|
</Form>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default DuckDuckGoForm;
|