Álvaro Valenzuela Valdes commited on
Commit ·
1002636
1
Parent(s): 19e0332
Improve PDF embedding compatibility for HF Spaces
Browse files
frontend/components/AgentAnalysis.tsx
CHANGED
|
@@ -515,22 +515,32 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 515 |
|
| 516 |
{/* PDF Viewer for Active Selection */}
|
| 517 |
{activeAnimalId && pdfUrls[activeAnimalId] && (
|
| 518 |
-
<div className="mt-6 rounded-2xl overflow-hidden border border-white/10 bg-black/40 h-80 relative group">
|
| 519 |
-
<
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
{
|
| 526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 527 |
<a
|
| 528 |
href={pdfUrls[activeAnimalId]}
|
| 529 |
target="_blank"
|
| 530 |
rel="noopener noreferrer"
|
| 531 |
-
className="text-[
|
| 532 |
>
|
| 533 |
-
|
| 534 |
</a>
|
| 535 |
</div>
|
| 536 |
</div>
|
|
|
|
| 515 |
|
| 516 |
{/* PDF Viewer for Active Selection */}
|
| 517 |
{activeAnimalId && pdfUrls[activeAnimalId] && (
|
| 518 |
+
<div className="mt-6 rounded-2xl overflow-hidden border border-white/10 bg-black/40 h-80 relative group flex flex-col">
|
| 519 |
+
<div className="flex-1 w-full bg-slate-900/50 flex items-center justify-center relative">
|
| 520 |
+
<embed
|
| 521 |
+
src={pdfUrls[activeAnimalId]}
|
| 522 |
+
type="application/pdf"
|
| 523 |
+
className="w-full h-full"
|
| 524 |
+
/>
|
| 525 |
+
{/* Fallback Overlay for blocked frames */}
|
| 526 |
+
<div className="absolute inset-0 flex items-center justify-center pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity bg-black/40">
|
| 527 |
+
<p className="text-[10px] text-white font-bold bg-purple-600 px-3 py-1 rounded-full shadow-lg">Document Preview Mode</p>
|
| 528 |
+
</div>
|
| 529 |
+
</div>
|
| 530 |
+
<div className="p-3 bg-slate-950 flex justify-between items-center border-t border-white/5">
|
| 531 |
+
<div className="flex items-center gap-2">
|
| 532 |
+
<span className="text-xl">📄</span>
|
| 533 |
+
<p className="text-[10px] font-mono text-slate-300 truncate max-w-[120px]">
|
| 534 |
+
{corral.find(a => a.id === activeAnimalId)?.file.name}
|
| 535 |
+
</p>
|
| 536 |
+
</div>
|
| 537 |
<a
|
| 538 |
href={pdfUrls[activeAnimalId]}
|
| 539 |
target="_blank"
|
| 540 |
rel="noopener noreferrer"
|
| 541 |
+
className="px-3 py-1 rounded-lg bg-cyan/10 border border-cyan/20 text-[10px] font-black text-cyan hover:bg-cyan hover:text-black transition-all"
|
| 542 |
>
|
| 543 |
+
OPEN FULL PDF ↗
|
| 544 |
</a>
|
| 545 |
</div>
|
| 546 |
</div>
|