Storybook: Add controls to LoadingPlaceholder story (#54939)

This commit is contained in:
Tima Gixe 2022-09-09 13:35:41 +03:00 committed by GitHub
parent 76f0037654
commit 6b2ff6f25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ import React from 'react';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { LoadingPlaceholder } from './LoadingPlaceholder';
import { LoadingPlaceholder, LoadingPlaceholderProps } from './LoadingPlaceholder';
import mdx from './LoadingPlaceholder.mdx';
const meta: ComponentMeta<typeof LoadingPlaceholder> = {
@ -15,10 +15,19 @@ const meta: ComponentMeta<typeof LoadingPlaceholder> = {
page: mdx,
},
},
argTypes: {
text: {
control: { type: 'text' },
},
},
};
export const basic: ComponentStory<typeof LoadingPlaceholder> = () => {
return <LoadingPlaceholder text="Loading..." />;
export const Basic: ComponentStory<typeof LoadingPlaceholder> = (args: LoadingPlaceholderProps) => {
return <LoadingPlaceholder {...args} />;
};
Basic.args = {
text: 'Loading...',
};
export default meta;