Skip to content

Commit 86c76e5

Browse files
committed
Refactor LicenseBannerView stories
1 parent 1cd9b18 commit 86c76e5

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed
Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
import { Story } from "@storybook/react";
2-
import { LicenseBannerView, LicenseBannerViewProps } from "./LicenseBannerView";
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
import { LicenseBannerView } from "./LicenseBannerView";
33

4-
export default {
4+
const meta: Meta<typeof LicenseBannerView> = {
55
title: "components/LicenseBannerView",
66
component: LicenseBannerView,
77
};
88

9-
const Template: Story<LicenseBannerViewProps> = (args) => (
10-
<LicenseBannerView {...args} />
11-
);
9+
export default meta;
10+
type Story = StoryObj<typeof LicenseBannerView>;
1211

13-
export const OneWarning = Template.bind({});
14-
OneWarning.args = {
15-
errors: [],
16-
warnings: ["You have exceeded the number of seats in your license."],
12+
export const OneWarning: Story = {
13+
args: {
14+
errors: [],
15+
warnings: ["You have exceeded the number of seats in your license."],
16+
},
1717
};
1818

19-
export const TwoWarnings = Template.bind({});
20-
TwoWarnings.args = {
21-
errors: [],
22-
warnings: [
23-
"You have exceeded the number of seats in your license.",
24-
"You are flying too close to the sun.",
25-
],
19+
export const TwoWarnings: Story = {
20+
args: {
21+
errors: [],
22+
warnings: [
23+
"You have exceeded the number of seats in your license.",
24+
"You are flying too close to the sun.",
25+
],
26+
},
2627
};
2728

28-
export const OneError = Template.bind({});
29-
OneError.args = {
30-
errors: [
31-
"You have multiple replicas but high availability is an Enterprise feature. You will be unable to connect to workspaces.",
32-
],
33-
warnings: [],
29+
export const OneError: Story = {
30+
args: {
31+
errors: [
32+
"You have multiple replicas but high availability is an Enterprise feature. You will be unable to connect to workspaces.",
33+
],
34+
warnings: [],
35+
},
3436
};

0 commit comments

Comments
 (0)