{{-- Follow Card — rendered in the "My Follows" tab of the pilots listing. Receives: $follow : array from PilotPresenter::forMyFollows() with keys: id, pilot_id, pilot_name, pilot_initials, avatar_color, min_entry, wallet, today_profit, lifetime_profit, trades_won, trades_lost, win_rate, profile_url Action buttons (Topup, Unfollow) link to the pilot profile page where modals will be wired in Step 7. View details also lands there. --}} @php $color = in_array($follow['avatar_color'], ['orange','purple','red'], true) ? $follow['avatar_color'] : 'orange'; $colorHex = match($color) { 'orange' => '#f97316', 'purple' => '#660066', 'red' => '#ec595a', default => '#f97316', }; $minEntry = '$' . number_format((float) $follow['min_entry'], 0); $wallet = '$' . number_format((float) $follow['wallet'], 2); $todayProfit = (float) $follow['today_profit']; $lifetimeProfit= (float) $follow['lifetime_profit']; // Smart sign: only "+" when positive, only "-" when negative, plain when zero $todayDisplay = match(true) { $todayProfit > 0 => '+$' . number_format($todayProfit, 2), $todayProfit < 0 => '-$' . number_format(abs($todayProfit), 2), default => '$0.00', }; $lifeDisplay = match(true) { $lifetimeProfit > 0 => '+$' . number_format($lifetimeProfit, 2), $lifetimeProfit < 0 => '-$' . number_format(abs($lifetimeProfit), 2), default => '$0.00', }; $todayClass = $todayProfit > 0 ? 'up' : ($todayProfit < 0 ? 'down' : ''); $lifeClass = $lifetimeProfit > 0 ? 'up' : ($lifetimeProfit < 0 ? 'down' : ''); $totalTrades = (int) $follow['trades_won'] + (int) $follow['trades_lost']; $winRate = (float) $follow['win_rate']; // Win rate confidence: muted when small sample, hidden when no data if ($totalTrades === 0) { $winRateStr = 'Pending'; $winRateClass = 'is-empty'; } else { $winRateStr = ($winRate > 0 ? '+' : '') . rtrim(rtrim(number_format($winRate, 1), '0'), '.') . '%'; $winRateClass = $totalTrades < 10 ? 'is-early' : ''; } @endphp
Wallet
{{ $wallet }}
Today
{{ $todayDisplay }}
Lifetime
{{ $lifeDisplay }}
@php $w = (int) $follow['trades_won']; $l = (int) $follow['trades_lost']; $tradesEmpty = ($w === 0 && $l === 0); @endphp
Trades
{{ number_format($w) }}W · {{ number_format($l) }}L
View details