// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { ComponentProps } from 'react'; import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { setupI18n } from '../util/setupI18n'; import enMessages from '../../_locales/en/messages.json'; import { getFakeBadge, getFakeBadges } from '../test-both/helpers/getFakeBadge'; import { repeat, zipObject } from '../util/iterables'; import { BadgeImageTheme } from '../badges/BadgeImageTheme'; import { BadgeDialog } from './BadgeDialog'; const i18n = setupI18n('en', enMessages); const story = storiesOf('Components/BadgeDialog', module); const defaultProps: ComponentProps = { areWeASubscriber: false, badges: getFakeBadges(3), firstName: 'Alice', i18n, onClose: action('onClose'), title: 'Alice Levine', }; story.add('No badges (closed immediately)', () => ( )); story.add('One badge', () => ( )); story.add('Badge with no image (should be impossible)', () => ( )); story.add('Badge with pending image', () => ( )); story.add('Badge with only one, low-detail image', () => ( )); story.add('Five badges', () => ( )); story.add('Many badges', () => ( )); story.add('Many badges, user is a subscriber', () => ( ));