import React from 'react' import { Button } from '../ui' import { FileText, Download } from 'lucide-react' import { formatFileSize } from '../../utils' export interface FileDownloadCardProps { fileName?: string mimeType?: string fileSize?: number fileUrl?: string } /** * Generic downloadable-file card for the `file` document type. Used by * ``'s default `documentTypeRenderers.file`. Embedders can * override the default by passing their own `file` renderer. * * When `fileUrl` is missing, the Download button is omitted (the card still * renders the filename + type + size so the user knows what they were * about to download). */ export function FileDownloadCard({ fileName, mimeType, fileSize, fileUrl, }: FileDownloadCardProps) { return (

{fileName || 'File'}

{mimeType && {mimeType}} {typeof fileSize === 'number' && {formatFileSize(fileSize)}}
{fileUrl && ( )}
) }