// 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 { Props } from './ImageGrid'; import { ImageGrid } from './ImageGrid'; import { AUDIO_MP3, IMAGE_JPEG, IMAGE_PNG, IMAGE_WEBP, VIDEO_MP4, stringToMIMEType, } from '../../types/MIME'; import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures'; import { fakeAttachment } from '../../test-both/helpers/fakeAttachment'; const i18n = setupI18n('en', enMessages); export default { title: 'Components/Conversation/ImageGrid', argTypes: { bottomOverlay: { control: { type: 'boolean' } }, isSticker: { control: { type: 'boolean' } }, stickerSize: { control: { type: 'number' } }, withContentAbove: { control: { type: 'boolean' } }, withContentBelow: { control: { type: 'boolean' } }, }, args: { attachments: [ fakeAttachment({ contentType: IMAGE_PNG, fileName: 'sax.png', height: 1200, url: pngUrl, width: 800, }), ], bottomOverlay: false, direction: 'incoming', i18n, isSticker: false, onClick: action('onClick'), onError: action('onError'), stickerSize: 0, tabIndex: 0, withContentAbove: false, withContentBelow: false, }, } satisfies Meta; export function OneImage(args: Props): JSX.Element { return ; } export function TwoImages(args: Props): JSX.Element { return ( ); } export function ThreeImages(args: Props): JSX.Element { return ( ); } export function FourImages(args: Props): JSX.Element { return ( ); } export function FiveImages(args: Props): JSX.Element { return ( ); } export const _6Images = (args: Props): JSX.Element => { return ( ); }; export function MixedContentTypes(args: Props): JSX.Element { return ( ); } export function Sticker(args: Props): JSX.Element { return ( ); } export function ContentAboveAndBelow(args: Props): JSX.Element { return ; } export function BottomOverlay(args: Props): JSX.Element { return ; }