// Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; import type { PropsType } from './GroupV1MigrationDialog'; import { GroupV1MigrationDialog } from './GroupV1MigrationDialog'; import type { ConversationType } from '../state/ducks/conversations'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation'; import { ThemeType } from '../types/Util'; const i18n = setupI18n('en', enMessages); const contact1: ConversationType = getDefaultConversation({ title: 'Alice', phoneNumber: '+1 (300) 555-0000', id: 'guid-1', }); const contact2: ConversationType = getDefaultConversation({ title: 'Bob', phoneNumber: '+1 (300) 555-0001', id: 'guid-2', }); const contact3: ConversationType = getDefaultConversation({ title: 'Chet', phoneNumber: '+1 (300) 555-0002', id: 'guid-3', }); const createProps = (overrideProps: Partial = {}): PropsType => ({ areWeInvited: Boolean(overrideProps.areWeInvited), droppedMembers: overrideProps.droppedMembers, droppedMemberCount: overrideProps.droppedMemberCount || 0, getPreferredBadge: () => undefined, hasMigrated: Boolean(overrideProps.hasMigrated), i18n, invitedMembers: overrideProps.invitedMembers, invitedMemberCount: overrideProps.invitedMemberCount || 0, onMigrate: action('onMigrate'), onClose: action('onClose'), theme: ThemeType.light, }); export default { title: 'Components/GroupV1MigrationDialog', } satisfies Meta; export function NotYetMigratedBasic(): JSX.Element { return ; } export function MigratedBasic(): JSX.Element { return ( ); } export function MigratedYouAreInvited(): JSX.Element { return ( ); } export function MigratedMultipleDroppedAndInvitedMember(): JSX.Element { return ( ); } export function MigratedMultipleDroppedAndInvitedMembers(): JSX.Element { return ( ); } export function MigratedNoMembers(): JSX.Element { return ( ); } export function NotYetMigratedJustDroppedMember(): JSX.Element { return ( ); } export function NotYetMigratedJustDroppedMembers(): JSX.Element { return ( ); } export function NotYetMigratedDropped1(): JSX.Element { return ( ); } export function NotYetMigratedDropped2(): JSX.Element { return ( ); } export function MigratedJustCountIs1(): JSX.Element { return ( ); } export function MigratedJustCountIs2(): JSX.Element { return ( ); }