|
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"; |
3 | 3 |
|
4 |
| -export default { |
| 4 | +const meta: Meta<typeof LicenseBannerView> = { |
5 | 5 | title: "components/LicenseBannerView",
|
6 | 6 | component: LicenseBannerView,
|
7 | 7 | };
|
8 | 8 |
|
9 |
| -const Template: Story<LicenseBannerViewProps> = (args) => ( |
10 |
| - <LicenseBannerView {...args} /> |
11 |
| -); |
| 9 | +export default meta; |
| 10 | +type Story = StoryObj<typeof LicenseBannerView>; |
12 | 11 |
|
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 | + }, |
17 | 17 | };
|
18 | 18 |
|
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 | + }, |
26 | 27 | };
|
27 | 28 |
|
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 | + }, |
34 | 36 | };
|
0 commit comments