@extends('layouts.franchise', ['heading' => 'Commission Report'])

@section('content')
    <div class="mb-4 flex gap-2">
        <a href="{{ request()->fullUrlWithQuery(['export' => 'excel']) }}" class="rounded border px-3 py-2 text-sm">Excel</a>
        <a href="{{ request()->fullUrlWithQuery(['export' => 'pdf']) }}" class="rounded border px-3 py-2 text-sm">PDF</a>
    </div>

    <div class="grid grid-cols-1 gap-3">
        @forelse($rows as $row)
            <div class="rounded-2xl bg-white p-4 shadow">
                <div class="font-semibold">{{ $row->transaction_type }}</div>
                <div class="text-sm text-slate-600">? {{ number_format((float) $row->amount, 2) }}</div>
                <div class="text-xs text-slate-500">{{ optional($row->transacted_at)->format('d M Y') }}</div>
            </div>
        @empty
            <div class="rounded-2xl bg-white p-4 text-center text-slate-500">No commission records.</div>
        @endforelse
    </div>
@endsection

