import React, { useState } from 'react'; import type { ComponentMeta } from '@storybook/react'; import type { BannerSize } from '@tih/ui'; import { Banner } from '@tih/ui'; const bannerSizes: ReadonlyArray = ['xs', 'sm', 'md']; export default { argTypes: { children: { control: 'text', }, size: { control: { type: 'select' }, options: bannerSizes, }, }, component: Banner, title: 'Banner', } as ComponentMeta; export const Basic = { args: { children: 'This notice is going to change your life', size: 'md', }, }; export function Sizes() { const [isShown, setIsShown] = useState(true); const [isShown2, setIsShown2] = useState(true); const [isShown3, setIsShown3] = useState(true); return (
{isShown && ( setIsShown(false)}> This notice is going to change your life unless you close it. )} {isShown2 && ( setIsShown2(false)}> This smaller notice is going to change your life unless you close it. )} {isShown3 && ( setIsShown3(false)}> This even smaller notice is going to change your life unless you close it. )}
); }