{{-- 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, status, starting_amount, initial_amount, topup_count, unfollow_requested_at, projection, pilot_cut_percent Two visual states, keyed by $follow['status']: active -> standard card, Topup + Unfollow buttons live winding_down -> amber accent, projection numbers, no action buttons (backend has already locked the exit; user is waiting for open positions to settle before the sweep fires) Chinedu-owned file per initial memory scope. All state branching is additive via @if/@else so the active-state HTML tree is untouched below. --}} @php $color = in_array($follow['avatar_color'], ['orange','purple','red'], true) ? $follow['avatar_color'] : 'orange'; $status = $follow['status'] ?? 'active'; $isWindingDown = $status === 'winding_down'; $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' : ''; } // -- Phase 13: projection numbers for modal + winding-down display -- $projection = $follow['projection'] ?? []; $committed = (float) ($projection['committed'] ?? $follow['starting_amount'] ?? 0); $idle = (float) ($projection['idle_capital'] ?? $follow['wallet'] ?? 0); $openCount = (int) ($projection['open_positions_count'] ?? 0); $markToMarket = (float) ($projection['mark_to_market'] ?? $idle); $unrealProfit = (float) ($projection['unrealized_profit'] ?? 0); $unrealCut = (float) ($projection['unrealized_cut'] ?? 0); $takeHome = (float) ($projection['take_home_now'] ?? $idle); $cutPct = (float) ($follow['pilot_cut_percent'] ?? 30); // Wind-down elapsed $requestedAgo = null; if ($isWindingDown && !empty($follow['unfollow_requested_at'])) { $requestedAgo = \Carbon\Carbon::parse($follow['unfollow_requested_at'])->diffForHumans(null, true); } // Card modifier class $cardModifiers = 'follow-card--c-' . $color; if ($isWindingDown) { $cardModifiers .= ' follow-card--winding-down'; } @endphp
@if($isWindingDown) {{-- WINDING DOWN STATE --}}
Committed
${{ number_format($committed, 2) }}
Positions settling
{{ $openCount }}
Expected return
~${{ number_format($takeHome, 2) }}
@if($openCount > 0) Your positions will keep selling. Your Main Wallet is credited automatically once the last one settles. @else All positions have settled. Your Main Wallet will be credited on the next settlement pass. @endif @if($unrealProfit > 0) Pilot cut ({{ number_format($cutPct, 0) }}%) applies to ${{ number_format($unrealProfit, 2) }} profit only: ~${{ number_format($unrealCut, 2) }}. @endif
@if($requestedAgo) Requested {{ $requestedAgo }} ago · @endif Usually settles in 24-48 hours
View details
@else {{-- ACTIVE STATE --}}
Wallet
{{ $wallet }}
Today
{{ $todayDisplay }}
Lifetime
{{ $lifeDisplay }}
@php $w = (int) $follow['trades_won']; $l = (int) $follow['trades_lost']; $tradesEmpty = ($w === 0 && $l === 0); @endphp
Sales
{{ number_format($w) }}W · {{ number_format($l) }}L
View details
@endif