Skip to content

Commit c4cd628

Browse files
committed
Refactor LoadingButton stories
1 parent c9f1371 commit c4cd628

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
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";
33

4-
export default {
4+
const meta: Meta<typeof LoadingButton> = {
55
title: "components/LoadingButton",
66
component: LoadingButton,
7-
argTypes: {
8-
loading: { control: "boolean" },
9-
children: { control: "text" },
10-
},
117
args: {
128
children: "Create workspace",
139
},
1410
};
1511

16-
const Template: Story<LoadingButtonProps> = (args) => (
17-
<LoadingButton {...args} />
18-
);
12+
export default meta;
13+
type Story = StoryObj<typeof LoadingButton>;
1914

20-
export const Loading = Template.bind({});
21-
Loading.args = {
22-
loading: true,
15+
export const Loading: Story = {
16+
args: {
17+
loading: true,
18+
},
2319
};
2420

25-
export const NotLoading = Template.bind({});
26-
NotLoading.args = {
27-
loading: false,
21+
export const NotLoading: Story = {
22+
args: {
23+
loading: false,
24+
},
2825
};

0 commit comments

Comments
 (0)