mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: Submit Feedback #2088 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import CopyToClipboard from '@/components/copy-to-clipboard';
|
||||
import { useSetModalState } from '@/hooks/common-hooks';
|
||||
import {
|
||||
DeleteOutlined,
|
||||
DislikeOutlined,
|
||||
@ -8,21 +7,33 @@ import {
|
||||
SyncOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { Radio } from 'antd';
|
||||
import { useCallback } from 'react';
|
||||
import FeedbackModal from './feedback-modal';
|
||||
import { useSendFeedback } from './hooks';
|
||||
|
||||
export const AssistantGroupButton = () => {
|
||||
const { visible, hideModal, showModal } = useSetModalState();
|
||||
interface IProps {
|
||||
messageId: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export const AssistantGroupButton = ({ messageId, content }: IProps) => {
|
||||
const { visible, hideModal, showModal, onFeedbackOk, loading } =
|
||||
useSendFeedback(messageId);
|
||||
|
||||
const handleLike = useCallback(() => {
|
||||
onFeedbackOk({ thumbup: true });
|
||||
}, [onFeedbackOk]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Radio.Group size="small">
|
||||
<Radio.Button value="a">
|
||||
<CopyToClipboard text="xxx"></CopyToClipboard>
|
||||
<CopyToClipboard text={content}></CopyToClipboard>
|
||||
</Radio.Button>
|
||||
<Radio.Button value="b">
|
||||
<SoundOutlined />
|
||||
</Radio.Button>
|
||||
<Radio.Button value="c">
|
||||
<Radio.Button value="c" onClick={handleLike}>
|
||||
<LikeOutlined />
|
||||
</Radio.Button>
|
||||
<Radio.Button value="d" onClick={showModal}>
|
||||
@ -30,7 +41,12 @@ export const AssistantGroupButton = () => {
|
||||
</Radio.Button>
|
||||
</Radio.Group>
|
||||
{visible && (
|
||||
<FeedbackModal visible={visible} hideModal={hideModal}></FeedbackModal>
|
||||
<FeedbackModal
|
||||
visible={visible}
|
||||
hideModal={hideModal}
|
||||
onOk={onFeedbackOk}
|
||||
loading={loading}
|
||||
></FeedbackModal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user