diff --git a/resources/js/components/Display/StatsBox.tsx b/resources/js/components/Display/StatsBox.tsx index ef690a5..eafa4aa 100644 --- a/resources/js/components/Display/StatsBox.tsx +++ b/resources/js/components/Display/StatsBox.tsx @@ -86,7 +86,7 @@ export default function StatsBox({
@@ -123,7 +123,7 @@ export default function StatsBox({ onUpdatePrice(); setIsDropdownOpen(false); }} - className="w-full text-left px-4 py-2 text-green-400 hover:bg-green-600/20 hover:text-green-300 transition-colors text-sm font-mono border-b border-red-500/20 last:border-b-0" + className="w-full text-left px-4 py-2 text-red-400 hover:bg-red-600/20 hover:text-red-300 transition-colors transition-colors text-sm font-mono border-b border-red-500/20 last:border-b-0" > UPDATE PRICE @@ -136,7 +136,7 @@ export default function StatsBox({ {milestones.length > 1 && (
{/* Milestone Table */} -
-
MILESTONES
+
+
MILESTONES
- - - - - + + + + + - {/* Create combined array with current position and milestones, sorted by target */} - {[ - ...milestones.map(m => ({ ...m, isCurrent: false })), - { - target: stats.totalShares, - description: 'CURRENT', - created_at: '', - isCurrent: true - } - ] - .sort((a, b) => a.target - b.target) - .map((item, index) => { - const swr3 = stats.currentPrice ? item.target * stats.currentPrice * 0.03 : 0; - const swr4 = stats.currentPrice ? item.target * stats.currentPrice * 0.04 : 0; + {/* Current position row */} + + + + + + - // Check if this milestone is the selected one for progress bar - const isSelectedMilestone = !item.isCurrent && milestones.findIndex(m => - m.target === item.target && m.description === item.description - ) === selectedMilestoneIndex; + {/* Render milestones after current */} + {milestones.map((milestone, index) => { + const swr3 = stats.currentPrice ? milestone.target * stats.currentPrice * 0.03 : 0; + const swr4 = stats.currentPrice ? milestone.target * stats.currentPrice * 0.04 : 0; + + const isSelectedMilestone = index === selectedMilestoneIndex; return ( = item.target - ? "text-green-400/80" - : "text-red-400/70" + isSelectedMilestone + ? "text-red-500 font-bold" + : "bg-red-500 text-black" )} > - - - -
DESCRIPTIONSHARESSWR 3%SWR 4%
DESCRIPTIONSHARESSWR 3%SWR 4%
CURRENT + {Math.floor(stats.totalShares).toLocaleString()} + + {stats.currentPrice ? formatCurrency(stats.totalShares * stats.currentPrice * 0.03) : 'N/A'} + + {stats.currentPrice ? formatCurrency(stats.totalShares * stats.currentPrice * 0.04) : 'N/A'} +
- {item.isCurrent ? ( - {item.description} - ) : ( - item.description - )} + + {milestone.description} - {Math.floor(item.target).toLocaleString()} + + {Math.floor(milestone.target).toLocaleString()} + {stats.currentPrice ? formatCurrency(swr3) : 'N/A'} + {stats.currentPrice ? formatCurrency(swr4) : 'N/A'}