1
1
import { action } from "@storybook/addon-actions" ;
2
- import { Story } from "@storybook/react" ;
3
2
import { UseTabResult } from "hooks/useTab" ;
4
3
import {
5
4
mockApiError ,
@@ -11,15 +10,7 @@ import {
11
10
TemplateVersionPageView ,
12
11
TemplateVersionPageViewProps ,
13
12
} from "./TemplateVersionPageView" ;
14
-
15
- export default {
16
- title : "pages/TemplateVersionPageView" ,
17
- component : TemplateVersionPageView ,
18
- } ;
19
-
20
- const Template : Story < TemplateVersionPageViewProps > = ( args ) => (
21
- < TemplateVersionPageView { ...args } />
22
- ) ;
13
+ import type { Meta , StoryObj } from "@storybook/react" ;
23
14
24
15
const tab : UseTabResult = {
25
16
value : "0" ,
@@ -53,18 +44,26 @@ const defaultArgs: TemplateVersionPageViewProps = {
53
44
} ,
54
45
} ;
55
46
56
- export const Default = Template . bind ( { } ) ;
57
- Default . args = defaultArgs ;
47
+ const meta : Meta < typeof TemplateVersionPageView > = {
48
+ title : "pages/TemplateVersionPageView" ,
49
+ component : TemplateVersionPageView ,
50
+ args : defaultArgs ,
51
+ } ;
52
+
53
+ export default meta ;
54
+ type Story = StoryObj < typeof TemplateVersionPageView > ;
58
55
59
- export const Error = Template . bind ( { } ) ;
60
- Error . args = {
61
- ...defaultArgs ,
62
- context : {
63
- ...defaultArgs . context ,
64
- currentVersion : undefined ,
65
- currentFiles : undefined ,
66
- error : mockApiError ( {
67
- message : "Error on loading the template version" ,
68
- } ) ,
56
+ export const Default : Story = { } ;
57
+
58
+ export const Error : Story = {
59
+ args : {
60
+ context : {
61
+ ...defaultArgs . context ,
62
+ currentVersion : undefined ,
63
+ currentFiles : undefined ,
64
+ error : mockApiError ( {
65
+ message : "Error on loading the template version" ,
66
+ } ) ,
67
+ } ,
69
68
} ,
70
69
} ;
0 commit comments