fix HistoryEntry children prop conflict and overlay CopyButton in ContentViewer
Rename HistoryEntry's children prop to childEntries to avoid React's reserved prop name. Replace ContentViewer's onCopy callback with a copyable flag and overlay CopyButton in the top-right corner. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5d35a5f94c
commit
8d434e2381
1 changed files with 38 additions and 17 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { fn } from "storybook/test";
|
||||
import { ContentViewer } from "./ContentViewer";
|
||||
|
||||
const meta: Meta<typeof ContentViewer> = {
|
||||
|
|
@ -74,6 +73,15 @@ export const WithCopyButton: Story = {
|
|||
args: {
|
||||
type: "text",
|
||||
content: "Hello, world!\nThis text can be copied.",
|
||||
onCopy: fn(),
|
||||
copyable: true,
|
||||
},
|
||||
};
|
||||
|
||||
export const JsonWithCopy: Story = {
|
||||
args: {
|
||||
type: "json",
|
||||
content:
|
||||
'{"name":"my-app","version":"1.0.0","description":"Sample configuration file"}',
|
||||
copyable: true,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue