mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-15 14:08:49 +00:00
14 lines
329 B
TypeScript
14 lines
329 B
TypeScript
import { Button, useClipboard } from '@chakra-ui/react';
|
|
|
|
const CopyButton = ({ copyText, buttonText = 'copy', ...props }) => {
|
|
const { hasCopied, onCopy } = useClipboard(copyText);
|
|
|
|
return (
|
|
<Button onClick={onCopy} {...props}>
|
|
{hasCopied ? 'copied' : buttonText}
|
|
</Button>
|
|
);
|
|
};
|
|
|
|
export default CopyButton;
|