mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-08-26 01:16:36 +00:00
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
![]() |
import { useTranslate } from '@/hooks/commonHooks';
|
||
|
import type { FormProps } from 'antd';
|
||
|
import { Form, Input } from 'antd';
|
||
|
import { IOperatorForm } from '../interface';
|
||
|
|
||
|
type FieldType = {
|
||
|
prologue?: string;
|
||
|
};
|
||
|
|
||
|
const onFinish: FormProps<FieldType>['onFinish'] = (values) => {
|
||
|
console.log('Success:', values);
|
||
|
};
|
||
|
|
||
|
const onFinishFailed: FormProps<FieldType>['onFinishFailed'] = (errorInfo) => {
|
||
|
console.log('Failed:', errorInfo);
|
||
|
};
|
||
|
|
||
|
const MessageForm = ({ onValuesChange, form }: IOperatorForm) => {
|
||
|
const { t } = useTranslate('chat');
|
||
|
|
||
|
return (
|
||
|
<Form
|
||
|
name="basic"
|
||
|
labelCol={{ span: 8 }}
|
||
|
wrapperCol={{ span: 16 }}
|
||
|
style={{ maxWidth: 600 }}
|
||
|
initialValues={{ remember: true }}
|
||
|
onFinish={onFinish}
|
||
|
onFinishFailed={onFinishFailed}
|
||
|
onValuesChange={onValuesChange}
|
||
|
autoComplete="off"
|
||
|
form={form}
|
||
|
>
|
||
|
<Form.Item<FieldType>
|
||
|
name={'prologue'}
|
||
|
label={t('setAnOpener')}
|
||
|
tooltip={t('setAnOpenerTip')}
|
||
|
initialValue={t('setAnOpenerInitial')}
|
||
|
>
|
||
|
<Input.TextArea autoSize={{ minRows: 5 }} />
|
||
|
</Form.Item>
|
||
|
</Form>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default MessageForm;
|