<table>
    <thead>
        <tr>
            <th>Client</th>
            <th>Plan</th>
            <th>Amount</th>
            <th>Method</th>
            <th>Transaction</th>
            <th>Proof</th>
            <th>Date</th>
            <th>Status</th>
        </tr>
    </thead>
    <tbody>
        @forelse ($payments as $payment)
            <tr>
                <td>{{ $payment->client->name ?? '-' }}</td>
                <td>{{ $payment->plan->name ?? '-' }}</td>
                <td>{{ number_format((float) $payment->amount) }}</td>
                <td>{{ $payment->method }}</td>
                <td>{{ $payment->transaction_reference ?: '-' }}</td>
                <td>
                    @if ($payment->proof_path)
                        <a class="ghost small" target="_blank" href="{{ asset('storage/'.$payment->proof_path) }}">Screenshot</a>
                    @else
                        -
                    @endif
                </td>
                <td>{{ ($payment->paid_at ?? $payment->created_at)?->format('M j, Y') }}</td>
                <td><span class="badge status-{{ str($payment->status)->slug() }}">{{ str($payment->status)->headline() }}</span></td>
            </tr>
        @empty
            <tr><td colspan="8">No payments yet.</td></tr>
        @endforelse
    </tbody>
</table>
