import { useId } from 'react' import { ExternalLink, Download, FileText } from 'lucide-react' import { openFile as openFileUrl } from '../../utils/fileDownload' import type { FileManagerState } from './useFileManager' import { triggerDownload } from './FileManager.helpers' import { DialogHeader, DialogShell, DialogTile, NEUTRAL_TINT, PILL } from '../shared/DialogShell' /** A PDF read in place, in the planner's dialog: the name on the head band, open and download beside it. */ export function PdfPreviewModal(S: FileManagerState) { const { previewFile, setPreviewFile, previewFileUrl, toast, t } = S const labelId = useId() const close = () => setPreviewFile(null) const openInTab = () => openFileUrl(previewFile.url, previewFile.original_name).catch(() => toast.error(t('files.openError'))) return ( } tint={NEUTRAL_TINT} labelId={labelId} onClose={close} title={previewFile.original_name} pills={( <> )} /> )} >

) }