import { Download, ExternalLink } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { cn, relativeTime } from "@/lib/utils"; import { formatBytes, isImageContentType, isVideoContentType, outputFilename, type IssueOutputItem, } from "@/lib/issue-output"; import { OutputVideoPlayer } from "./OutputVideoPlayer"; import { OutputFileTile } from "./OutputFileTile"; interface OutputPrimaryCardProps { item: IssueOutputItem; creatorName?: string | null; } /** * Full-width primary output card: media region (video / image / generic file) * over a metadata strip with Open + Download actions. The layout stacks on * mobile and uses a single horizontal meta row on desktop. */ export function OutputPrimaryCard({ item, creatorName }: OutputPrimaryCardProps) { const meta = item.metadata; const filename = outputFilename(item); const contentType = meta?.contentType; return (
{/* Media region */} {meta && isVideoContentType(contentType) ? ( ) : meta && isImageContentType(contentType) ? ( {filename} ) : (
)} {/* Metadata strip */}

{filename}

{item.degraded ? (

Output metadata is unavailable — this file can’t be played or downloaded here.

) : (
{item.isPrimary && ( Primary )} {meta && {meta.contentType}} {meta && } {meta && {formatBytes(meta.byteSize)}} {creatorName && } {creatorName && {creatorName}} {relativeTime(item.createdAt)}
)}
{meta ? (
) : null}
); }