// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { times, range } from 'lodash'; import { storiesOf } from '@storybook/react'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation'; import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo'; const i18n = setupI18n('en', enMessages); const getDefaultGroupConversation = () => getDefaultConversation({ name: 'Tahoe Trip', phoneNumber: undefined, profileName: undefined, title: 'Tahoe Trip', type: 'group', }); const otherMembers = times(6, () => getDefaultConversation()); const story = storiesOf('Components/CallingPreCallInfo', module); story.add('Direct conversation', () => ( )); times(5, numberOfOtherPeople => { [true, false].forEach(willRing => { story.add( `Group conversation, group has ${numberOfOtherPeople} other member${ numberOfOtherPeople === 1 ? '' : 's' }, will ${willRing ? 'ring' : 'notify'}`, () => ( ) ); }); }); range(1, 5).forEach(numberOfOtherPeople => { story.add( `Group conversation, ${numberOfOtherPeople} peeked participant${ numberOfOtherPeople === 1 ? '' : 's' }`, () => ( ) ); }); story.add('Group conversation, you on an other device', () => { const me = getDefaultConversation(); return ( ); }); story.add('Group conversation, call is full', () => ( ));