forked from infiniflow/ragflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add FeedbackModal infiniflow#2088 (infiniflow#2089)
### What problem does this PR solve? feat: Add FeedbackModal infiniflow#2088 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
- Loading branch information
Showing
3 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Form, Input, Modal } from 'antd'; | ||
|
||
import { IModalProps } from '@/interfaces/common'; | ||
|
||
type FieldType = { | ||
username?: string; | ||
}; | ||
|
||
const FeedbackModal = ({ visible, hideModal }: IModalProps<any>) => { | ||
const [form] = Form.useForm(); | ||
|
||
const handleOk = async () => { | ||
const ret = await form.validateFields(); | ||
}; | ||
|
||
return ( | ||
<Modal title="Feedback" open={visible} onOk={handleOk} onCancel={hideModal}> | ||
<Form | ||
name="basic" | ||
labelCol={{ span: 0 }} | ||
wrapperCol={{ span: 24 }} | ||
style={{ maxWidth: 600 }} | ||
autoComplete="off" | ||
form={form} | ||
> | ||
<Form.Item<FieldType> | ||
name="username" | ||
rules={[{ required: true, message: 'Please input your username!' }]} | ||
> | ||
<Input.TextArea rows={8} placeholder="Please input your username!" /> | ||
</Form.Item> | ||
</Form> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default FeedbackModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import CopyToClipboard from '@/components/copy-to-clipboard'; | ||
import { useSetModalState } from '@/hooks/common-hooks'; | ||
import { | ||
DeleteOutlined, | ||
DislikeOutlined, | ||
LikeOutlined, | ||
SoundOutlined, | ||
SyncOutlined, | ||
} from '@ant-design/icons'; | ||
import { Radio } from 'antd'; | ||
import FeedbackModal from './feedback-modal'; | ||
|
||
export const AssistantGroupButton = () => { | ||
const { visible, hideModal, showModal } = useSetModalState(); | ||
|
||
return ( | ||
<> | ||
<Radio.Group size="small"> | ||
<Radio.Button value="a"> | ||
<CopyToClipboard text="xxx"></CopyToClipboard> | ||
</Radio.Button> | ||
<Radio.Button value="b"> | ||
<SoundOutlined /> | ||
</Radio.Button> | ||
<Radio.Button value="c"> | ||
<LikeOutlined /> | ||
</Radio.Button> | ||
<Radio.Button value="d" onClick={showModal}> | ||
<DislikeOutlined /> | ||
</Radio.Button> | ||
</Radio.Group> | ||
{visible && ( | ||
<FeedbackModal visible={visible} hideModal={hideModal}></FeedbackModal> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export const UserGroupButton = () => { | ||
return ( | ||
<Radio.Group size="small"> | ||
<Radio.Button value="a"> | ||
<CopyToClipboard text="xxx"></CopyToClipboard> | ||
</Radio.Button> | ||
<Radio.Button value="b"> | ||
<SyncOutlined /> | ||
</Radio.Button> | ||
<Radio.Button value="c"> | ||
<DeleteOutlined /> | ||
</Radio.Button> | ||
</Radio.Group> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters