Álvaro Valenzuela Valdes commited on
Commit
36b89a1
·
1 Parent(s): b61d95b

fix: Implemented functional Back to Opportunities button in AgentAnalysis

Browse files
frontend/app/page.tsx CHANGED
@@ -264,6 +264,7 @@ export default function HomePage() {
264
  companyProfile={companyProfile}
265
  analysis={analysisResult}
266
  onAnalyze={handleRunAnalysis}
 
267
  />
268
  )}
269
  {activeTab === "Proposal Draft" && <ProposalDraft proposal={analysisResult?.proposal_draft ?? ""} />}
 
264
  companyProfile={companyProfile}
265
  analysis={analysisResult}
266
  onAnalyze={handleRunAnalysis}
267
+ onBackToSearch={() => setActiveTab("Tender Search")}
268
  />
269
  )}
270
  {activeTab === "Proposal Draft" && <ProposalDraft proposal={analysisResult?.proposal_draft ?? ""} />}
frontend/components/AgentAnalysis.tsx CHANGED
@@ -9,6 +9,7 @@ type Props = {
9
  companyProfile: CompanyProfile;
10
  analysis: AnalysisResult | null;
11
  onAnalyze: (documentText?: string, models?: Record<string, string>) => Promise<void>;
 
12
  };
13
 
14
  const agents = [
@@ -17,7 +18,7 @@ const agents = [
17
  { id: "risk", name: "Sra. Estrategia", role: "ROI & Risk", avatar: "🕵️‍♀️", color: "text-purple-400", desc: "Calculates commercial impact and win probability." },
18
  ];
19
 
20
- export default function AgentAnalysis({ tender, companyProfile, analysis, onAnalyze }: Props) {
21
  const [approved, setApproved] = useState(false);
22
  const [isRunning, setIsRunning] = useState(false);
23
  const [file, setFile] = useState<File | null>(null);
@@ -85,16 +86,30 @@ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnal
85
  ))}
86
  </div>
87
 
88
- <div className="flex items-center gap-3 text-slate-600 animate-bounce">
89
- <span className="text-sm font-bold uppercase tracking-widest">Go to Tender Search</span>
90
- <span className="text-xl">↓</span>
91
- </div>
 
 
 
92
  </div>
93
  );
94
  }
95
 
96
  return (
97
  <div className="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-700">
 
 
 
 
 
 
 
 
 
 
 
98
  {/* Tender Header Card */}
99
  <div className="glass-card relative overflow-hidden rounded-3xl p-8 border border-white/10">
100
  <div className="absolute -right-20 -top-20 h-64 w-64 rounded-full bg-purple-500/10 blur-[100px]" />
 
9
  companyProfile: CompanyProfile;
10
  analysis: AnalysisResult | null;
11
  onAnalyze: (documentText?: string, models?: Record<string, string>) => Promise<void>;
12
+ onBackToSearch: () => void;
13
  };
14
 
15
  const agents = [
 
18
  { id: "risk", name: "Sra. Estrategia", role: "ROI & Risk", avatar: "🕵️‍♀️", color: "text-purple-400", desc: "Calculates commercial impact and win probability." },
19
  ];
20
 
21
+ export default function AgentAnalysis({ tender, companyProfile, analysis, onAnalyze, onBackToSearch }: Props) {
22
  const [approved, setApproved] = useState(false);
23
  const [isRunning, setIsRunning] = useState(false);
24
  const [file, setFile] = useState<File | null>(null);
 
86
  ))}
87
  </div>
88
 
89
+ <button
90
+ onClick={onBackToSearch}
91
+ className="flex items-center gap-3 text-purple-400 hover:text-purple-300 transition-all active:scale-95 group"
92
+ >
93
+ <span className="text-xl transition-transform group-hover:-translate-x-1">←</span>
94
+ <span className="text-sm font-bold uppercase tracking-widest underline decoration-purple-500/30 underline-offset-8">Back to Opportunities</span>
95
+ </button>
96
  </div>
97
  );
98
  }
99
 
100
  return (
101
  <div className="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-700">
102
+ {/* Navigation Header */}
103
+ <div className="flex justify-start">
104
+ <button
105
+ onClick={onBackToSearch}
106
+ className="flex items-center gap-3 text-slate-500 hover:text-white transition-all group"
107
+ >
108
+ <span className="text-xl transition-transform group-hover:-translate-x-1">←</span>
109
+ <span className="text-[10px] font-bold uppercase tracking-widest">Back to Opportunities</span>
110
+ </button>
111
+ </div>
112
+
113
  {/* Tender Header Card */}
114
  <div className="glass-card relative overflow-hidden rounded-3xl p-8 border border-white/10">
115
  <div className="absolute -right-20 -top-20 h-64 w-64 rounded-full bg-purple-500/10 blur-[100px]" />