import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { action } from 'storybook/actions'; import { Person, Briefcase as BriefcaseIcon } from '@transferwise/icons'; import { createSandboxStory, globalScope, } from '../../../../.storybook/components/sandbox/SandboxEditor'; import AvatarView from '../../../AvatarView'; import { ProfileType } from '../../../common'; import Logo from '../../../Logo'; import OverlayHeader, { OverlayHeaderProps } from '..'; interface CustomControls { avatarType?: keyof typeof avatarProfiles; avatarURL?: string; profileType?: ProfileType; } export type StoryArgs = OverlayHeaderProps & CustomControls; /** * @deprecated Use `FlowNavigation` component instead */ const meta: Meta = { component: OverlayHeader, title: 'Navigation/OverlayHeader', tags: ['deprecated'], argTypes: { avatarType: { control: 'select', options: ['', 'Business', 'Profile'] }, avatarURL: { control: 'text' }, profileType: { control: 'select', options: [ProfileType.PERSONAL, ProfileType.BUSINESS] }, }, }; export default meta; const avatarProfiles = { '': null, Business: , Profile: , }; export const Sandbox = createSandboxStory({ code: `} logo={} onClose={() => console.log('Close clicked')} />`, scope: globalScope, }); export const Basic: StoryObj = { render: (args) => ( } avatar={{avatarProfiles[args.avatarType ?? '']}} onClose={action('Close clicked')} /> ), args: { avatarType: 'Profile', }, }; export const WithAvatarWrapper: StoryObj = { render: (args) => ( } avatar={} onClose={action('Close clicked')} /> ), args: { avatarURL: '../tapestry-01.png', profileType: ProfileType.PERSONAL, }, };