// Copyright 2020-2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import { storiesOf } from '@storybook/react'; import { boolean, number } from '@storybook/addon-knobs'; import { action } from '@storybook/addon-actions'; import type { PropsType } from './CallingHeader'; import { CallingHeader } from './CallingHeader'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; const i18n = setupI18n('en', enMessages); const createProps = (overrideProps: Partial = {}): PropsType => ({ i18n, isGroupCall: boolean('isGroupCall', Boolean(overrideProps.isGroupCall)), message: overrideProps.message, participantCount: number( 'participantCount', overrideProps.participantCount || 0 ), showParticipantsList: boolean( 'showParticipantsList', Boolean(overrideProps.showParticipantsList) ), title: overrideProps.title || 'With Someone', toggleParticipants: () => action('toggle-participants'), togglePip: () => action('toggle-pip'), toggleSettings: () => action('toggle-settings'), }); const story = storiesOf('Components/CallingHeader', module); story.add('Default', () => ); story.add('Lobby style', () => ( )); story.add('With Participants', () => ( )); story.add('With Participants (shown)', () => ( )); story.add('Long Title', () => ( )); story.add('Title with message', () => ( ));