chore: playground layout
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import useCopyToClipboard from '@/hooks/use-copy-to-clipboard';
|
||||
import { CheckCircleFilled, CopyOutlined } from '@ant-design/icons';
|
||||
import { Button } from 'antd';
|
||||
|
||||
type CopyButtonProps = {
|
||||
text: string;
|
||||
disabled?: boolean;
|
||||
size?: 'small' | 'middle' | 'large';
|
||||
};
|
||||
|
||||
const CopyButton: React.FC<CopyButtonProps> = ({
|
||||
text,
|
||||
disabled,
|
||||
size = 'middle'
|
||||
}) => {
|
||||
const { copied, copyToClipboard } = useCopyToClipboard();
|
||||
|
||||
const handleCopy = async (e: any) => {
|
||||
e.stopPropagation();
|
||||
await copyToClipboard(text);
|
||||
};
|
||||
return (
|
||||
<Button
|
||||
type="text"
|
||||
shape="circle"
|
||||
size={size}
|
||||
onClick={handleCopy}
|
||||
disabled={!!disabled}
|
||||
>
|
||||
{copied ? (
|
||||
<CheckCircleFilled
|
||||
style={{ color: 'var(--ant-color-primary)', fontSize: '14px' }}
|
||||
/>
|
||||
) : (
|
||||
<CopyOutlined
|
||||
style={{ color: 'var(--ant-color-primary)', fontSize: '14px' }}
|
||||
/>
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export default CopyButton;
|
||||
@@ -9,7 +9,6 @@ interface NoteInfoProps {
|
||||
description?: React.ReactNode;
|
||||
}
|
||||
const NoteInfo: React.FC<NoteInfoProps> = (props) => {
|
||||
console.log('props+++++++++', props);
|
||||
const { required, description, label } = props || {};
|
||||
return (
|
||||
<span className="label-text">
|
||||
|
||||
@@ -167,4 +167,7 @@
|
||||
top: -20px;
|
||||
height: @wrapheight - 2px;
|
||||
}
|
||||
:global(.ant-input-group-addon) {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user