|
1 |
| -import { Story } from "@storybook/react"; |
2 | 1 | import {
|
3 | 2 | mockApiError,
|
4 | 3 | MockOrganization,
|
5 | 4 | MockTemplateExample,
|
6 | 5 | } from "testHelpers/entities";
|
7 |
| -import { |
8 |
| - StarterTemplatePageView, |
9 |
| - StarterTemplatePageViewProps, |
10 |
| -} from "./StarterTemplatePageView"; |
| 6 | +import { StarterTemplatePageView } from "./StarterTemplatePageView"; |
| 7 | + |
| 8 | +import type { Meta, StoryObj } from "@storybook/react"; |
11 | 9 |
|
12 |
| -export default { |
| 10 | +const meta: Meta<typeof StarterTemplatePageView> = { |
13 | 11 | title: "pages/StarterTemplatePageView",
|
14 | 12 | component: StarterTemplatePageView,
|
15 | 13 | };
|
16 | 14 |
|
17 |
| -const Template: Story<StarterTemplatePageViewProps> = (args) => ( |
18 |
| - <StarterTemplatePageView {...args} /> |
19 |
| -); |
| 15 | +export default meta; |
| 16 | +type Story = StoryObj<typeof StarterTemplatePageView>; |
20 | 17 |
|
21 |
| -export const Default = Template.bind({}); |
22 |
| -Default.args = { |
23 |
| - context: { |
24 |
| - exampleId: MockTemplateExample.id, |
25 |
| - organizationId: MockOrganization.id, |
26 |
| - error: undefined, |
27 |
| - starterTemplate: MockTemplateExample, |
| 18 | +export const Default: Story = { |
| 19 | + args: { |
| 20 | + context: { |
| 21 | + exampleId: MockTemplateExample.id, |
| 22 | + organizationId: MockOrganization.id, |
| 23 | + error: undefined, |
| 24 | + starterTemplate: MockTemplateExample, |
| 25 | + }, |
28 | 26 | },
|
29 | 27 | };
|
30 |
| - |
31 |
| -export const Error = Template.bind({}); |
32 |
| -Error.args = { |
33 |
| - context: { |
34 |
| - exampleId: MockTemplateExample.id, |
35 |
| - organizationId: MockOrganization.id, |
36 |
| - error: mockApiError({ |
37 |
| - message: `Example ${MockTemplateExample.id} not found.`, |
38 |
| - }), |
39 |
| - starterTemplate: undefined, |
| 28 | +export const Error: Story = { |
| 29 | + args: { |
| 30 | + context: { |
| 31 | + exampleId: MockTemplateExample.id, |
| 32 | + organizationId: MockOrganization.id, |
| 33 | + error: mockApiError({ |
| 34 | + message: `Example ${MockTemplateExample.id} not found.`, |
| 35 | + }), |
| 36 | + starterTemplate: undefined, |
| 37 | + }, |
40 | 38 | },
|
41 | 39 | };
|
0 commit comments