Skip to content

Commit f30845b

Browse files
committed
Refactor Markdown stories
1 parent 2800c67 commit f30845b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

site/src/components/Markdown/Markdown.stories.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import { ComponentMeta, Story } from "@storybook/react";
2-
import { Markdown, MarkdownProps } from "./Markdown";
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
import { Markdown } from "./Markdown";
33

4-
export default {
4+
const meta: Meta<typeof Markdown> = {
55
title: "components/Markdown",
66
component: Markdown,
7-
} as ComponentMeta<typeof Markdown>;
7+
};
88

9-
const Template: Story<MarkdownProps> = ({ children }) => (
10-
<Markdown>{children}</Markdown>
11-
);
9+
export default meta;
10+
type Story = StoryObj<typeof Markdown>;
1211

13-
export const WithCode = Template.bind({});
14-
WithCode.args = {
15-
children: `
12+
export const WithCode: Story = {
13+
args: {
14+
children: `
1615
## Required permissions / policy
1716
1817
The following sample policy allows Coder to create EC2 instances and modify instances provisioned by Coder:
@@ -64,12 +63,14 @@ WithCode.args = {
6463
]
6564
}
6665
\`\`\``,
66+
},
6767
};
6868

69-
export const WithTable = Template.bind({});
70-
WithTable.args = {
71-
children: `
69+
export const WithTable: Story = {
70+
args: {
71+
children: `
7272
| heading | b | c | d |
7373
| - | :- | -: | :-: |
7474
| cell 1 | cell 2 | 3 | 4 | `,
75+
},
7576
};

0 commit comments

Comments
 (0)