import { PlayIcon, VideoCameraIcon } from '@phosphor-icons/react' import React from 'react' import Bubble from '../_shared/Bubble' import DismissButton from '../_shared/DismissButton' import MediaStackGrid, { MEDIA_STACK_MAX_VISIBLE, type MediaStackTile, } from '../_shared/MediaStackGrid' import { useSingleMediaRatio } from '../_shared/useSingleMediaRatio' import { useViewer } from '../_shared/useViewer' import VideoViewer, { type VideoViewerItem } from '../_shared/VideoViewer' import { bubbleVariantForState, type MediaPreloadMode, type MessageAttachmentBaseProps, type MessageAttachmentState, type VideoItem, } from '../types' export interface VideoAttachmentSharedProps extends MessageAttachmentBaseProps { /** Single video — convenience for the most common case. */ src?: string /** Poster image — preview shown before playback starts. */ poster?: string /** * Width ÷ height of the source clip. See `VideoItem.naturalAspectRatio` — * this is the single-`src` convenience form of the same thing, and is what * lets a posterless portrait clip size itself correctly (MES-1353). */ naturalAspectRatio?: number /** MIME type hint — typed onto the inline `` element. */ mimeType?: string /** Filename used as the viewer dialog's accessible name. */ filename?: string /** * Stacked videos. Takes precedence over `src` when set. Renders a * 1 / 2 / 3 / 4-tile grid (5+ collapse into a `+N` overflow tile). * Sent + Received only — the composer surface intentionally accepts * a single attachment at a time. */ items?: VideoItem[] /** * `