diff --git a/frontend/src/components/Badge.stories.tsx b/frontend/src/components/Badge.stories.tsx index aa622e99..96846a75 100644 --- a/frontend/src/components/Badge.stories.tsx +++ b/frontend/src/components/Badge.stories.tsx @@ -14,31 +14,26 @@ * @see https://storybook.js.org/docs/react/writing-stories/introduction */ -import { ComponentStory } from "@storybook/react"; -import Badge, { BadgeProps } from "./Badge"; +import { Meta } from "@storybook/react"; +import Badge from "./Badge"; -// We create a generic template for the component. - -const Template: ComponentStory = (args: BadgeProps) => ( - -); -// We export the story, and we pass the template to it. For now, -// we are only going to use the default story. -export const Default = Template.bind({}); -// We set the props for the story. Recall that the props are the same as the -// ones in BadgeProps, which we impoted. -Default.args = { - type: "success", - children: "Success", -}; // We set the metadata for the story. // Refer to https://storybook.js.org/docs/react/writing-stories/introduction // for more information. -export default { +const meta = { title: "Badge", component: Badge, args: { type: "success", children: "Success", }, +} satisfies Meta; + +export default meta; + +export const Default = { + args: { + type: "success", + children: "Success", + }, }; diff --git a/frontend/src/components/Button.stories.tsx b/frontend/src/components/Button.stories.tsx index 33b53b37..1d4d9188 100644 --- a/frontend/src/components/Button.stories.tsx +++ b/frontend/src/components/Button.stories.tsx @@ -1,35 +1,28 @@ /* eslint-disable no-console */ -// Status.stories.ts|tsx +import { Meta } from "@storybook/react"; +import Button from "./Button"; -import { ComponentStory, ComponentMeta } from "@storybook/react"; -import Button, { ButtonProps } from "./Button"; -//πŸ‘‡ This default export determines where your story goes in the story list -export default { +const meta = { /* πŸ‘‡ The title prop is optional. * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading * to learn how to generate automatic titles */ title: "Button", component: Button, -} as ComponentMeta; +} satisfies Meta; -// Recall that Button has 'props' which is of type ButtonProps -// We want to past theme to the story with the name 'Default', so we -// create a template for it. -// We want to declare default values for the props, so we create a -// default args object. -const Template: ComponentStory = (args: ButtonProps) => ( -