File tree 1 file changed +13
-16
lines changed
site/src/components/LoadingButton 1 file changed +13
-16
lines changed Original file line number Diff line number Diff line change 1
- import { Story } from "@storybook/react " ;
2
- import { LoadingButton , LoadingButtonProps } from "./LoadingButton " ;
1
+ import { LoadingButton } from "./LoadingButton " ;
2
+ import type { Meta , StoryObj } from "@storybook/react " ;
3
3
4
- export default {
4
+ const meta : Meta < typeof LoadingButton > = {
5
5
title : "components/LoadingButton" ,
6
6
component : LoadingButton ,
7
- argTypes : {
8
- loading : { control : "boolean" } ,
9
- children : { control : "text" } ,
10
- } ,
11
7
args : {
12
8
children : "Create workspace" ,
13
9
} ,
14
10
} ;
15
11
16
- const Template : Story < LoadingButtonProps > = ( args ) => (
17
- < LoadingButton { ...args } />
18
- ) ;
12
+ export default meta ;
13
+ type Story = StoryObj < typeof LoadingButton > ;
19
14
20
- export const Loading = Template . bind ( { } ) ;
21
- Loading . args = {
22
- loading : true ,
15
+ export const Loading : Story = {
16
+ args : {
17
+ loading : true ,
18
+ } ,
23
19
} ;
24
20
25
- export const NotLoading = Template . bind ( { } ) ;
26
- NotLoading . args = {
27
- loading : false ,
21
+ export const NotLoading : Story = {
22
+ args : {
23
+ loading : false ,
24
+ } ,
28
25
} ;
You can’t perform that action at this time.
0 commit comments