diff --git a/apps/docs/components/copy-button.tsx b/apps/docs/components/copy-button.tsx index e732cbd4f..ffdf7a92c 100644 --- a/apps/docs/components/copy-button.tsx +++ b/apps/docs/components/copy-button.tsx @@ -2,6 +2,7 @@ import type {ButtonProps} from "@heroui/react"; import {useClipboard} from "@heroui/use-clipboard"; import {memo} from "react"; +import {Tooltip} from "@heroui/react"; import {PreviewButton} from "./preview-button"; @@ -32,7 +33,17 @@ export const CopyButton = memo(({value, className, ...buttonPro copy(value); }; - return ; + return ( + + + + ); }); CopyButton.displayName = "CopyButton"; diff --git a/apps/docs/components/sandpack/copy-button.tsx b/apps/docs/components/sandpack/copy-button.tsx index 3dfb65d0d..4c69fdd7c 100644 --- a/apps/docs/components/sandpack/copy-button.tsx +++ b/apps/docs/components/sandpack/copy-button.tsx @@ -3,7 +3,7 @@ import {useSandpack} from "@codesandbox/sandpack-react"; import {Tooltip, Button} from "@heroui/react"; import {useClipboard} from "@heroui/use-clipboard"; -import {CopyLinearIcon} from "@/components/icons"; +import {CheckLinearIcon, CopyLinearIcon} from "@/components/icons"; export const CopyButton = ({code: codeProp}: {code?: string}) => { const {copy, copied} = useClipboard(); @@ -16,15 +16,33 @@ export const CopyButton = ({code: codeProp}: {code?: string}) => { copy(code); }; + const icon = copied ? ( + + ) : ( + + ); + return ( );