File size: 1,266 Bytes
ccbf758
284d945
ccbf758
cd85d9e
 
 
a2c2382
284d945
a2c2382
284d945
 
 
 
 
 
 
 
 
a2c2382
284d945
a2c2382
ccbf758
284d945
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import TopNItem from '@/components/top-n-item';
import { useTranslate } from '@/hooks/common-hooks';
import { Form, Select } from 'antd';
import { DeepLSourceLangOptions, DeepLTargetLangOptions } from '../../constant';
import { useBuildSortOptions } from '../../form-hooks';
import { IOperatorForm } from '../../interface';
import DynamicInputVariable from '../components/dynamic-input-variable';

const DeepLForm = ({ onValuesChange, form, node }: IOperatorForm) => {
  const { t } = useTranslate('flow');
  const options = useBuildSortOptions();

  return (
    <Form
      name="basic"
      autoComplete="off"
      form={form}
      onValuesChange={onValuesChange}
      layout={'vertical'}
    >
      <DynamicInputVariable nodeId={node?.id}></DynamicInputVariable>
      <TopNItem initialValue={5}></TopNItem>
      <Form.Item label={t('authKey')} name={'auth_key'}>
        <Select options={options}></Select>
      </Form.Item>
      <Form.Item label={t('sourceLang')} name={'source_lang'}>
        <Select options={DeepLSourceLangOptions}></Select>
      </Form.Item>
      <Form.Item label={t('targetLang')} name={'target_lang'}>
        <Select options={DeepLTargetLangOptions}></Select>
      </Form.Item>
    </Form>
  );
};

export default DeepLForm;