diff --git a/src/components/CodeBlock/CopyButton.tsx b/src/components/CodeBlock/CopyButton.tsx index 18f88c752..bc8e09f60 100644 --- a/src/components/CodeBlock/CopyButton.tsx +++ b/src/components/CodeBlock/CopyButton.tsx @@ -1,11 +1,23 @@ import React, { useState } from 'react'; import constants from 'utils/strings/constants'; -import { CopyButtonWrapper } from './styledComponents'; import DoneIcon from '@mui/icons-material/Done'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; -import { Tooltip } from '@mui/material'; +import { + IconButton, + IconButtonProps, + SvgIconProps, + Tooltip, +} from '@mui/material'; -export default function CopyButton({ code }) { +export default function CopyButton({ + code, + color, + size, +}: { + code: string; + color?: IconButtonProps['color']; + size?: SvgIconProps['fontSize']; +}) { const [copied, setCopied] = useState(false); const copyToClipboardHelper = (text: string) => () => { @@ -14,14 +26,18 @@ export default function CopyButton({ code }) { setTimeout(() => setCopied(false), 1000); }; return ( - - + + {copied ? ( - + ) : ( - + )} - + ); }