mirror of
https://gitee.com/ineo6/homebrew-install.git
synced 2025-04-06 03:58:05 +08:00
18 lines
405 B
TypeScript
18 lines
405 B
TypeScript
import React from 'react';
|
|
import { useCopy } from 'dumi/theme';
|
|
import './CopyButton.less';
|
|
|
|
export default (props: { content: string }) => {
|
|
const { content } = props;
|
|
const [copyCode, copyStatus] = useCopy();
|
|
|
|
return (
|
|
<button
|
|
className="__dumi-default-icon my-code-block-copy-btn"
|
|
role="copy"
|
|
data-status={copyStatus}
|
|
onClick={() => copyCode(content)}
|
|
/>
|
|
);
|
|
};
|