Skip to content

Commit e604b90

Browse files
committed
docs: update copy-text-morph block + doc example
1 parent 8837e02 commit e604b90

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

apps/website/src/components/previews/copy-text-morph-example.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,22 @@ import {
88
import { CodeblockShiki } from "@/components/code-block/client/shiki";
99
import { CopyTextMorph } from "@/components/code-block/blocks/copy-text-morph";
1010

11-
const code = `const copyToClipboard = async (text: string) => {
12-
try {
13-
await navigator.clipboard.writeText(text);
14-
console.log("Text copied to clipboard");
15-
} catch (err) {
16-
console.error("Failed to copy text: ", err);
17-
}
18-
};`;
11+
const code = `export default function Page() {
12+
return <h1>Hello</h1>
13+
}`;
1914

2015
const CopyMorphExample = () => {
2116
return (
2217
<CodeBlock>
2318
<CodeBlockHeader>
2419
<CodeBlockGroup>
25-
<CodeBlockIcon language="js" />
20+
<CodeBlockIcon language="tsx" />
2621
<span>Copy with Text Morph</span>
2722
</CodeBlockGroup>
2823
<CopyTextMorph content={code} />
2924
</CodeBlockHeader>
3025
<CodeBlockContent>
31-
<CodeblockShiki language="ts" code={code} />
26+
<CodeblockShiki language="tsx" code={code} />
3227
</CodeBlockContent>
3328
</CodeBlock>
3429
);

apps/website/src/docs/react/blocks/copy-text-morph.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In this block, we'll create a copy button that not only copies text to the clipb
3030

3131
<DocCard folder="react" document="code-block-client-shiki" />
3232

33-
4. Finally, create the `CopyTextAnimated` component:
33+
4. Finally, create the `CopyTextMorph` component:
3434

3535
<ShowSource component="block-copy-text-morph" />
3636

0 commit comments

Comments
 (0)