Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const CopyEmbed = withRouter(({ router: { asPath }, mapper, title, margin }) => {
const text = React.useMemo(() => mapper(asPath), [mapper, asPath])
const { onClick, copied } = useCopyTextHandler(text)
return (
<button style="{{" color="{COLORS.DARK_PURPLE}">
{copied ? 'Copied!' : title}
</button>
)
})
const CopyButton = React.memo(function CopyButton({ text }) {
const { onClick, copied } = useCopyTextHandler(text)
return (
<button aria-label="Copy Button">
{copied ? (
) : (
)}
<style>
{`
button {
border: none;
cursor: pointer;
color: ${COLORS.SECONDARY};
background: transparent;
}</style></button>