-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.stories.tsx
More file actions
39 lines (29 loc) · 845 Bytes
/
index.stories.tsx
File metadata and controls
39 lines (29 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
import BaseCodeBox from '#ui/Common/BaseCodeBox';
type Story = StoryObj<typeof BaseCodeBox>;
type Meta = MetaObj<typeof BaseCodeBox>;
const content = `const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
server.listen(port, hostname, () => {
console.log(\`Server running at http://\${hostname}:\${port}/\`);
});`;
const args = {
language: 'JavaScript (CJS)',
children: <code>{content}</code>,
};
export const Default: Story = {
args,
};
export const WithCopyButton: Story = {
args: {
...args,
showCopyButton: true,
},
};
export default { component: BaseCodeBox } as Meta;