Álvaro Valenzuela Valdes commited on
Commit ·
f7a5c63
1
Parent(s): e3b7ebb
Fix: Replace analysis with activeAnalysis in AgentAnalysis to resolve nullability type error
Browse files
frontend/components/AgentAnalysis.tsx
CHANGED
|
@@ -394,18 +394,18 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 394 |
</div>
|
| 395 |
</div>
|
| 396 |
<div className="prose prose-invert max-w-none">
|
| 397 |
-
<p className="text-slate-300 text-xl leading-relaxed italic border-l-4 border-purple-500 pl-8">{
|
| 398 |
</div>
|
| 399 |
|
| 400 |
{/* Requirement Q&A Section */}
|
| 401 |
-
{
|
| 402 |
<div className="mt-12 space-y-6">
|
| 403 |
<div className="flex items-center gap-3 border-b border-white/5 pb-4">
|
| 404 |
<span className="text-2xl">📋</span>
|
| 405 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-purple-400">Requirement Response (Q&A Style)</h4>
|
| 406 |
</div>
|
| 407 |
<div className="grid gap-4">
|
| 408 |
-
{
|
| 409 |
<div key={i} className="rounded-2xl bg-white/[0.03] border border-white/5 p-6 hover:border-purple-500/30 transition-all group">
|
| 410 |
<div className="flex gap-4">
|
| 411 |
<span className="text-purple-500 font-bold font-mono">Q.</span>
|
|
@@ -422,13 +422,13 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 422 |
)}
|
| 423 |
|
| 424 |
{/* Proposal Draft Section */}
|
| 425 |
-
{
|
| 426 |
<div className="mt-12 space-y-6">
|
| 427 |
<div className="flex items-center justify-between border-b border-white/5 pb-4">
|
| 428 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-purple-400">AI Generated Proposal Draft</h4>
|
| 429 |
<button
|
| 430 |
onClick={() => {
|
| 431 |
-
navigator.clipboard.writeText(
|
| 432 |
alert("Proposal copied to clipboard!");
|
| 433 |
}}
|
| 434 |
className="text-[10px] font-bold uppercase text-slate-500 hover:text-white transition"
|
|
@@ -437,7 +437,7 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 437 |
</button>
|
| 438 |
</div>
|
| 439 |
<div className="p-8 rounded-3xl bg-white/[0.03] border border-white/10 font-serif text-slate-400 text-sm leading-relaxed whitespace-pre-wrap max-h-[500px] overflow-y-auto custom-scrollbar">
|
| 440 |
-
{
|
| 441 |
</div>
|
| 442 |
</div>
|
| 443 |
)}
|
|
@@ -450,7 +450,7 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 450 |
<span>⚠️</span> Legal Compliance Gaps
|
| 451 |
</h4>
|
| 452 |
<ul className="space-y-4">
|
| 453 |
-
{
|
| 454 |
<li key={i} className="flex gap-4 text-sm text-slate-400 leading-relaxed">
|
| 455 |
<span className="text-amber-500 font-bold">•</span> {gap}
|
| 456 |
</li>
|
|
@@ -462,7 +462,7 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 462 |
<span>💎</span> Technical Requirements
|
| 463 |
</h4>
|
| 464 |
<ul className="space-y-4">
|
| 465 |
-
{
|
| 466 |
<li key={i} className="flex gap-4 text-sm text-slate-400 leading-relaxed">
|
| 467 |
<span className="text-cyan font-bold">▹</span> {req}
|
| 468 |
</li>
|
|
@@ -474,7 +474,7 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 474 |
<div className="glass-card rounded-3xl p-10 bg-white/[0.01]">
|
| 475 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-purple-400 mb-8 text-center">Neural Risk Matrix</h4>
|
| 476 |
<div className="grid gap-6 md:grid-cols-2 mb-12">
|
| 477 |
-
{
|
| 478 |
<div key={i} className="group rounded-3xl bg-white/[0.02] p-6 border border-white/5 hover:border-purple-500/30 transition-all duration-300">
|
| 479 |
<div className="flex items-center justify-between mb-4">
|
| 480 |
<span className="font-bold text-white text-lg group-hover:text-purple-400 transition">{risk.title}</span>
|
|
@@ -485,12 +485,12 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 485 |
))}
|
| 486 |
</div>
|
| 487 |
|
| 488 |
-
{
|
| 489 |
<div className="mt-8 pt-8 border-t border-white/5">
|
| 490 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-cyan mb-6 text-center">Winning Strategic Roadmap</h4>
|
| 491 |
<div className="p-8 rounded-3xl bg-cyan/5 border border-cyan/20 text-sm text-slate-300 leading-relaxed italic">
|
| 492 |
<div className="prose prose-invert prose-sm max-w-none">
|
| 493 |
-
{
|
| 494 |
<p key={i} className="mb-2">{line}</p>
|
| 495 |
))}
|
| 496 |
</div>
|
|
@@ -508,11 +508,11 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
|
|
| 508 |
<h4 className="text-[10px] font-bold uppercase tracking-widest text-slate-400">Agent Intelligence Log</h4>
|
| 509 |
</div>
|
| 510 |
<div className="space-y-8 overflow-y-auto max-h-[700px] pr-2 custom-scrollbar">
|
| 511 |
-
{
|
| 512 |
<div key={i} className="flex gap-5 group">
|
| 513 |
<div className="flex flex-col items-center">
|
| 514 |
<div className="h-8 w-8 rounded-xl bg-white/5 flex items-center justify-center text-sm border border-white/10 group-hover:border-purple-500/50 transition-all duration-300 shadow-lg">🤖</div>
|
| 515 |
-
{i < (
|
| 516 |
</div>
|
| 517 |
<div className="pb-6">
|
| 518 |
<p className="text-[13px] text-slate-400 leading-relaxed group-hover:text-white transition-colors duration-300">{log}</p>
|
|
|
|
| 394 |
</div>
|
| 395 |
</div>
|
| 396 |
<div className="prose prose-invert max-w-none">
|
| 397 |
+
<p className="text-slate-300 text-xl leading-relaxed italic border-l-4 border-purple-500 pl-8">{activeAnalysis.executive_summary}</p>
|
| 398 |
</div>
|
| 399 |
|
| 400 |
{/* Requirement Q&A Section */}
|
| 401 |
+
{activeAnalysis.requirement_responses && activeAnalysis.requirement_responses.length > 0 && (
|
| 402 |
<div className="mt-12 space-y-6">
|
| 403 |
<div className="flex items-center gap-3 border-b border-white/5 pb-4">
|
| 404 |
<span className="text-2xl">📋</span>
|
| 405 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-purple-400">Requirement Response (Q&A Style)</h4>
|
| 406 |
</div>
|
| 407 |
<div className="grid gap-4">
|
| 408 |
+
{activeAnalysis.requirement_responses.map((item, i) => (
|
| 409 |
<div key={i} className="rounded-2xl bg-white/[0.03] border border-white/5 p-6 hover:border-purple-500/30 transition-all group">
|
| 410 |
<div className="flex gap-4">
|
| 411 |
<span className="text-purple-500 font-bold font-mono">Q.</span>
|
|
|
|
| 422 |
)}
|
| 423 |
|
| 424 |
{/* Proposal Draft Section */}
|
| 425 |
+
{activeAnalysis.proposal_draft && (
|
| 426 |
<div className="mt-12 space-y-6">
|
| 427 |
<div className="flex items-center justify-between border-b border-white/5 pb-4">
|
| 428 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-purple-400">AI Generated Proposal Draft</h4>
|
| 429 |
<button
|
| 430 |
onClick={() => {
|
| 431 |
+
navigator.clipboard.writeText(activeAnalysis.proposal_draft);
|
| 432 |
alert("Proposal copied to clipboard!");
|
| 433 |
}}
|
| 434 |
className="text-[10px] font-bold uppercase text-slate-500 hover:text-white transition"
|
|
|
|
| 437 |
</button>
|
| 438 |
</div>
|
| 439 |
<div className="p-8 rounded-3xl bg-white/[0.03] border border-white/10 font-serif text-slate-400 text-sm leading-relaxed whitespace-pre-wrap max-h-[500px] overflow-y-auto custom-scrollbar">
|
| 440 |
+
{activeAnalysis.proposal_draft}
|
| 441 |
</div>
|
| 442 |
</div>
|
| 443 |
)}
|
|
|
|
| 450 |
<span>⚠️</span> Legal Compliance Gaps
|
| 451 |
</h4>
|
| 452 |
<ul className="space-y-4">
|
| 453 |
+
{activeAnalysis.compliance_gaps.map((gap, i) => (
|
| 454 |
<li key={i} className="flex gap-4 text-sm text-slate-400 leading-relaxed">
|
| 455 |
<span className="text-amber-500 font-bold">•</span> {gap}
|
| 456 |
</li>
|
|
|
|
| 462 |
<span>💎</span> Technical Requirements
|
| 463 |
</h4>
|
| 464 |
<ul className="space-y-4">
|
| 465 |
+
{activeAnalysis.key_requirements.map((req, i) => (
|
| 466 |
<li key={i} className="flex gap-4 text-sm text-slate-400 leading-relaxed">
|
| 467 |
<span className="text-cyan font-bold">▹</span> {req}
|
| 468 |
</li>
|
|
|
|
| 474 |
<div className="glass-card rounded-3xl p-10 bg-white/[0.01]">
|
| 475 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-purple-400 mb-8 text-center">Neural Risk Matrix</h4>
|
| 476 |
<div className="grid gap-6 md:grid-cols-2 mb-12">
|
| 477 |
+
{activeAnalysis.risks.map((risk, i) => (
|
| 478 |
<div key={i} className="group rounded-3xl bg-white/[0.02] p-6 border border-white/5 hover:border-purple-500/30 transition-all duration-300">
|
| 479 |
<div className="flex items-center justify-between mb-4">
|
| 480 |
<span className="font-bold text-white text-lg group-hover:text-purple-400 transition">{risk.title}</span>
|
|
|
|
| 485 |
))}
|
| 486 |
</div>
|
| 487 |
|
| 488 |
+
{activeAnalysis.strategic_roadmap && (
|
| 489 |
<div className="mt-8 pt-8 border-t border-white/5">
|
| 490 |
<h4 className="text-[11px] font-bold uppercase tracking-widest text-cyan mb-6 text-center">Winning Strategic Roadmap</h4>
|
| 491 |
<div className="p-8 rounded-3xl bg-cyan/5 border border-cyan/20 text-sm text-slate-300 leading-relaxed italic">
|
| 492 |
<div className="prose prose-invert prose-sm max-w-none">
|
| 493 |
+
{activeAnalysis.strategic_roadmap.split('\n').map((line, i) => (
|
| 494 |
<p key={i} className="mb-2">{line}</p>
|
| 495 |
))}
|
| 496 |
</div>
|
|
|
|
| 508 |
<h4 className="text-[10px] font-bold uppercase tracking-widest text-slate-400">Agent Intelligence Log</h4>
|
| 509 |
</div>
|
| 510 |
<div className="space-y-8 overflow-y-auto max-h-[700px] pr-2 custom-scrollbar">
|
| 511 |
+
{activeAnalysis.audit_log?.map((log, i) => (
|
| 512 |
<div key={i} className="flex gap-5 group">
|
| 513 |
<div className="flex flex-col items-center">
|
| 514 |
<div className="h-8 w-8 rounded-xl bg-white/5 flex items-center justify-center text-sm border border-white/10 group-hover:border-purple-500/50 transition-all duration-300 shadow-lg">🤖</div>
|
| 515 |
+
{i < (activeAnalysis.audit_log?.length ?? 0) - 1 && <div className="w-px flex-1 bg-gradient-to-b from-purple-500/40 to-transparent my-3" />}
|
| 516 |
</div>
|
| 517 |
<div className="pb-6">
|
| 518 |
<p className="text-[13px] text-slate-400 leading-relaxed group-hover:text-white transition-colors duration-300">{log}</p>
|