mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-13 19:42:15 +08:00
feat: Topic 详情消息 Value 列支持复制
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { CheckCircleFilled } from '@ant-design/icons';
|
||||
import { Tooltip } from 'knowdesign';
|
||||
import React, { useState } from 'react';
|
||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||
import { IconFont } from '@knowdesign/icons';
|
||||
import './index.less';
|
||||
|
||||
const ContentWithCopy = (props: { content: string }) => {
|
||||
const { content } = props;
|
||||
const [visible, setVisible] = useState(false);
|
||||
return (
|
||||
<CopyToClipboard text={content}>
|
||||
<div className="content-with-copy">
|
||||
<Tooltip title={content}>
|
||||
<span className="content">{content}</span>
|
||||
</Tooltip>
|
||||
{content && (
|
||||
<Tooltip
|
||||
title={
|
||||
<span>
|
||||
<CheckCircleFilled style={{ color: '#00b365' }} /> 复制成功
|
||||
</span>
|
||||
}
|
||||
visible={visible}
|
||||
onVisibleChange={() => setVisible(false)}
|
||||
>
|
||||
<IconFont className="copy-icon" type="icon-fuzhi" onClick={() => setVisible(true)} />
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</CopyToClipboard>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContentWithCopy;
|
||||
Reference in New Issue
Block a user