import type { Meta, StoryFn } from '@storybook/react' import React from 'react' import { StoryGrid, StoryHeading, StoryPage, StoryRow, } from '../stories/StoryTable' import type { PdfItem } from '../types' import PdfAttachment from '.' const PDF_SRC = 'https://www.w3.org/WAI/WCAG21/wcag21.pdf' const STACK_PDFS: PdfItem[] = [ { src: PDF_SRC, filename: 'ESOP-summary.pdf', fileSize: 388_658 }, { src: PDF_SRC, filename: 'Vesting-schedule.pdf', fileSize: 142_336 }, { src: PDF_SRC, filename: 'Cap-table-snapshot.pdf', fileSize: 96_021 }, { src: PDF_SRC, filename: 'Board-resolution.pdf', fileSize: 24_580 }, ] const meta: Meta = { title: 'MessageAttachment/PDF', parameters: { layout: 'fullscreen' }, } export default meta const handleDismiss = () => { console.log('Dismissed PDF attachment') } /** * Compact PDF row inside a chat bubble — icon + filename + `EXT · SIZE`. * Composer / Sent / Received are all interactive: clicking opens the * built-in `PdfViewer` (full-viewport iframe + filename + download). */ export const Single: StoryFn = () => ( } sent={ } received={ } /> } sent={ } received={ } /> } sent={} received={ } /> ) export const SingleWithText: StoryFn = () => ( } sent={ } received={ } /> } sent={ } received={ } /> ) /** * Stacked PDF attachments — multiple PDFs in one bubble. Each row is * its own tappable target that opens the `PdfViewer` for that file. * * Sent + Received only — the composer surface accepts a single * attachment at a time (the user picks files one at a time inside the * file picker, so the composer preview lives outside this scenario). */ export const Stacked: StoryFn = () => ( } sent={} received={} /> } sent={} received={} /> } sent={} received={} /> ) /** Stacked PDFs with an accompanying caption. * Sent + Received only — see `Stacked` for the rationale. */ export const StackedWithText: StoryFn = () => ( } sent={ } received={ } /> } sent={ } received={ } /> )