Álvaro Valenzuela Valdes commited on
Commit ·
f8f0757
1
Parent(s): 482905a
Fix search button click handler and improve modal UX - separate Search and Save sections
Browse files
frontend/components/TenderSearch.tsx
CHANGED
|
@@ -263,8 +263,9 @@ export default function TenderSearch({ tenders, onSearch, onAnalyze, forceShowFo
|
|
| 263 |
<div className="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
|
| 264 |
<div className="flex flex-col gap-2">
|
| 265 |
<button
|
| 266 |
-
type="
|
| 267 |
disabled={isLoading}
|
|
|
|
| 268 |
className="w-full sm:w-auto premium-gradient hover:opacity-90 text-white font-bold py-3.5 rounded-xl transition-all shadow-lg shadow-purple-500/20 active:scale-[0.98] disabled:opacity-50"
|
| 269 |
>
|
| 270 |
{searchButtonLabel}
|
|
@@ -432,25 +433,32 @@ export default function TenderSearch({ tenders, onSearch, onAnalyze, forceShowFo
|
|
| 432 |
<div className="animate-in slide-in-from-right-8 fade-in duration-700 w-full max-w-[1600px] mx-auto pt-4 pb-20">
|
| 433 |
|
| 434 |
|
| 435 |
-
<div className="flex
|
| 436 |
<button
|
| 437 |
onClick={() => setSelectedTenderForModal(null)}
|
| 438 |
-
className="flex items-center gap-2 text-slate-400 hover:text-white transition group"
|
| 439 |
>
|
| 440 |
<span className="text-xl group-hover:-translate-x-1 transition-transform">←</span>
|
| 441 |
-
<span className="text-sm font-bold uppercase tracking-widest">{lang === 'en' ? 'Back to
|
| 442 |
</button>
|
| 443 |
-
<div className="
|
| 444 |
-
<
|
| 445 |
-
|
| 446 |
-
className=
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
</div>
|
| 455 |
</div>
|
| 456 |
|
|
@@ -623,23 +631,27 @@ export default function TenderSearch({ tenders, onSearch, onAnalyze, forceShowFo
|
|
| 623 |
<div className="flex items-center gap-4">
|
| 624 |
<div className="w-12 h-12 rounded-full bg-cyan/10 border border-cyan/20 flex items-center justify-center text-cyan">🤖</div>
|
| 625 |
<div>
|
| 626 |
-
<p className="text-white font-bold text-sm">Ready for
|
| 627 |
-
<p className="text-slate-500 text-xs">
|
| 628 |
</div>
|
| 629 |
</div>
|
| 630 |
-
<div className="flex items-center gap-
|
| 631 |
<button
|
| 632 |
-
onClick={() =>
|
| 633 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 634 |
>
|
| 635 |
-
{
|
| 636 |
</button>
|
| 637 |
<button
|
| 638 |
onClick={() => {
|
| 639 |
onAnalyze(selectedTenderForModal);
|
| 640 |
setSelectedTenderForModal(null);
|
| 641 |
}}
|
| 642 |
-
className="flex-1 md:flex-none premium-gradient text-white px-
|
| 643 |
>
|
| 644 |
{t.analyze}
|
| 645 |
</button>
|
|
|
|
| 263 |
<div className="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
|
| 264 |
<div className="flex flex-col gap-2">
|
| 265 |
<button
|
| 266 |
+
type="button"
|
| 267 |
disabled={isLoading}
|
| 268 |
+
onClick={handleSearch}
|
| 269 |
className="w-full sm:w-auto premium-gradient hover:opacity-90 text-white font-bold py-3.5 rounded-xl transition-all shadow-lg shadow-purple-500/20 active:scale-[0.98] disabled:opacity-50"
|
| 270 |
>
|
| 271 |
{searchButtonLabel}
|
|
|
|
| 433 |
<div className="animate-in slide-in-from-right-8 fade-in duration-700 w-full max-w-[1600px] mx-auto pt-4 pb-20">
|
| 434 |
|
| 435 |
|
| 436 |
+
<div className="flex flex-col gap-6 mb-8">
|
| 437 |
<button
|
| 438 |
onClick={() => setSelectedTenderForModal(null)}
|
| 439 |
+
className="flex items-center gap-2 text-slate-400 hover:text-white transition group w-fit"
|
| 440 |
>
|
| 441 |
<span className="text-xl group-hover:-translate-x-1 transition-transform">←</span>
|
| 442 |
+
<span className="text-sm font-bold uppercase tracking-widest">{lang === 'en' ? 'Back to search' : 'Volver a búsqueda'}</span>
|
| 443 |
</button>
|
| 444 |
+
<div className="grid grid-cols-2 gap-4">
|
| 445 |
+
<div className="px-4 py-3 rounded-lg bg-white/5 border border-white/10">
|
| 446 |
+
<div className="text-[10px] font-black uppercase tracking-[0.2em] text-slate-400 mb-2">Search</div>
|
| 447 |
+
<p className="text-xs text-slate-300">View detailed information</p>
|
| 448 |
+
</div>
|
| 449 |
+
<div className="px-4 py-3 rounded-lg bg-purple-500/5 border border-purple-500/20">
|
| 450 |
+
<div className="text-[10px] font-black uppercase tracking-[0.2em] text-purple-300 mb-2">Save</div>
|
| 451 |
+
<button
|
| 452 |
+
onClick={() => toggleFollow(selectedTenderForModal)}
|
| 453 |
+
className={`text-xs font-bold transition-all ${
|
| 454 |
+
followedCodes.includes(selectedTenderForModal.code)
|
| 455 |
+
? "text-purple-300"
|
| 456 |
+
: "text-slate-400 hover:text-purple-300"
|
| 457 |
+
}`}
|
| 458 |
+
>
|
| 459 |
+
{followedCodes.includes(selectedTenderForModal.code) ? "★ Saved to Portfolio" : "☆ Save to Portfolio"}
|
| 460 |
+
</button>
|
| 461 |
+
</div>
|
| 462 |
</div>
|
| 463 |
</div>
|
| 464 |
|
|
|
|
| 631 |
<div className="flex items-center gap-4">
|
| 632 |
<div className="w-12 h-12 rounded-full bg-cyan/10 border border-cyan/20 flex items-center justify-center text-cyan">🤖</div>
|
| 633 |
<div>
|
| 634 |
+
<p className="text-white font-bold text-sm">Ready for Analysis</p>
|
| 635 |
+
<p className="text-slate-500 text-xs">Run AI compliance check and opportunity fit assessment.</p>
|
| 636 |
</div>
|
| 637 |
</div>
|
| 638 |
+
<div className="flex items-center gap-4 w-full md:w-auto">
|
| 639 |
<button
|
| 640 |
+
onClick={() => toggleFollow(selectedTenderForModal)}
|
| 641 |
+
className={`flex-1 md:flex-none px-6 py-3 text-xs font-bold uppercase tracking-widest rounded-lg border transition-all ${
|
| 642 |
+
followedCodes.includes(selectedTenderForModal.code)
|
| 643 |
+
? 'bg-purple-500/20 border-purple-500/40 text-purple-300'
|
| 644 |
+
: 'border-white/10 text-slate-400 hover:border-purple-400/40 hover:text-purple-300'
|
| 645 |
+
}`}
|
| 646 |
>
|
| 647 |
+
{followedCodes.includes(selectedTenderForModal.code) ? "★ In Portfolio" : "☆ Add to Portfolio"}
|
| 648 |
</button>
|
| 649 |
<button
|
| 650 |
onClick={() => {
|
| 651 |
onAnalyze(selectedTenderForModal);
|
| 652 |
setSelectedTenderForModal(null);
|
| 653 |
}}
|
| 654 |
+
className="flex-1 md:flex-none premium-gradient text-white px-8 py-3 rounded-lg font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-purple-500/30 hover:scale-105 active:scale-95 transition-all"
|
| 655 |
>
|
| 656 |
{t.analyze}
|
| 657 |
</button>
|