@extends('layouts.millage') @section('title', 'Trade History') @section('content')
{{-- Display Errors --}} @if ($errors->any())
@endif {{-- Header with Summary Stats --}}
{{-- Total Trades --}}

Total Trades

{{ number_format($summary['total_trades']) }}

{{-- Total Profit/Loss --}}

Total P/L

{{ $summary['total_profit'] >= 0 ? '+' : '' }}${{ number_format($summary['total_profit'], 2) }}

$summary['total_profit'] >= 0, 'bg-red-500/10' => $summary['total_profit'] < 0, ])> $summary['total_profit'] >= 0, 'text-red-500' => $summary['total_profit'] < 0, ])>
{{-- Wins --}}

Wins

{{ number_format($summary['win_count']) }}

{{-- Losses --}}

Losses

{{ number_format($summary['loss_count']) }}

{{-- Filters and Table --}}
{{-- Filters --}}
{{-- Status Filter --}}
{{-- Type Filter --}}
{{-- Date Range Filter --}}
{{-- Submit and Reset Filters --}}
@if(request('status') || request('type') || request('dateRange')) Reset @endif
{{-- Table and Cards --}}
{{-- Table Layout for Small and Above Screens --}} @forelse($trades as $trade) @empty @endforelse {{-- Card Layout for Mobile --}}
@forelse($trades as $trade)
Time: {{ $trade->created_at->format('M d, Y H:i:s') }}
Type: $trade->type === 'Rise', 'bg-red-500/10 text-red-500' => $trade->type === 'Fall', ])> {{ $trade->type }}
Amount: ${{ number_format($trade->amount, 2) }}
Entry Price: ${{ number_format($trade->entry_price, 2) }}
Status: @if($trade->status === 'active')
Active
@elseif($trade->status === 'completed') $trade->result === 'win', 'text-red-500' => $trade->result === 'loss', ])> {{ ucfirst($trade->result) }} @else {{ ucfirst($trade->status) }} @endif
Profit/Loss: @if($trade->status === 'completed') $trade->profit_amount >= 0, 'text-red-500' => $trade->profit_amount < 0, ])> {{ $trade->profit_amount >= 0 ? '+' : '' }}${{ number_format($trade->profit_amount, 2) }} @else -- @endif
@empty

No trades found

Start Trading
@endforelse
{{-- Pagination --}} @if($trades->hasPages())
{{ $trades->links() }}
@endif
@endsection