Add PDF inline preview support to knowledge base viewer
This commit is contained in:
@@ -191,16 +191,28 @@ export default function KnowledgeBaseViewer({ article, onClose }) {
|
||||
|
||||
{/* PDF */}
|
||||
{isPDF && (
|
||||
<div className="w-full" style={{ height: '700px' }}>
|
||||
<iframe
|
||||
src={`${API_BASE}/knowledge-base/${article.id}/content`}
|
||||
title={article.title}
|
||||
className="w-full h-full rounded"
|
||||
style={{
|
||||
border: '1px solid rgba(14, 165, 233, 0.3)',
|
||||
background: 'rgba(15, 23, 42, 0.8)'
|
||||
}}
|
||||
>
|
||||
<div className="text-center py-12">
|
||||
<File className="w-16 h-16 mx-auto mb-4" style={{ color: '#EF4444' }} />
|
||||
<p className="mb-4" style={{ color: '#94A3B8' }}>
|
||||
PDF Preview not available. Click the download button to view this file.
|
||||
Your browser doesn't support PDF preview. Click the download button to view this file.
|
||||
</p>
|
||||
<button onClick={handleDownload} className="intel-button intel-button-success">
|
||||
<Download className="w-4 h-4 mr-2" />
|
||||
Download PDF
|
||||
</button>
|
||||
</div>
|
||||
</iframe>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Images */}
|
||||
|
||||
Reference in New Issue
Block a user