mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-31 04:59:24 +08:00
### What problem does this PR solve? Fix: Fixed the issue where the required information in the input box was incorrect when inviting users #2834 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
TypeScript
import { IModalProps } from '@/interfaces/common';
|
|
import { Form, Input, Modal } from 'antd';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
const AddingUserModal = ({
|
|
visible,
|
|
hideModal,
|
|
loading,
|
|
onOk,
|
|
}: IModalProps<string>) => {
|
|
const [form] = Form.useForm();
|
|
const { t } = useTranslation();
|
|
|
|
type FieldType = {
|
|
email?: string;
|
|
};
|
|
|
|
const handleOk = async () => {
|
|
const ret = await form.validateFields();
|
|
|
|
return onOk?.(ret.email);
|
|
};
|
|
|
|
return (
|
|
<Modal
|
|
title={t('setting.add')}
|
|
open={visible}
|
|
onOk={handleOk}
|
|
onCancel={hideModal}
|
|
okButtonProps={{ loading }}
|
|
confirmLoading={loading}
|
|
>
|
|
<Form
|
|
name="basic"
|
|
labelCol={{ span: 6 }}
|
|
wrapperCol={{ span: 18 }}
|
|
autoComplete="off"
|
|
form={form}
|
|
>
|
|
<Form.Item<FieldType>
|
|
label={t('setting.email')}
|
|
name="email"
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</Form>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default AddingUserModal;
|