<x-app-layout><x-slot name="header"><div class="flex items-center justify-between"><div><h1 class="text-2xl font-bold">Collections</h1><p class="text-sm text-slate-500">Paid, partial and outstanding contributions.</p></div><a href="{{ route('contributions.create') }}" class="rounded-xl bg-emerald-600 px-4 py-2 text-sm font-semibold text-white">Record payment</a></div></x-slot><div class="mx-auto max-w-7xl space-y-4 px-4 py-8 sm:px-6 lg:px-8">@if(session('status'))<div class="rounded-xl bg-emerald-50 p-3 text-sm text-emerald-700">{{ session('status') }}</div>@endif<form><select name="status" onchange="this.form.submit()" class="rounded-xl border-slate-300 bg-white dark:border-slate-700 dark:bg-slate-900"><option value="">All statuses</option>@foreach(['paid','partial','outstanding'] as $status)<option @selected(request('status')===$status)>{{ $status }}</option>@endforeach</select></form><div class="overflow-hidden rounded-2xl border border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-900"><div class="overflow-x-auto"><table class="w-full text-left text-sm"><thead class="bg-slate-50 text-xs uppercase text-slate-500 dark:bg-slate-800"><tr><th class="p-4">Receipt</th><th class="p-4">Member</th><th class="p-4">Group</th><th class="p-4">Paid / Due</th><th class="p-4">Status</th><th></th></tr></thead><tbody class="divide-y divide-slate-100 dark:divide-slate-800">@forelse($contributions as $item)<tr><td class="p-4 text-xs">{{ $item->receipt_number }}</td><td class="p-4 font-medium">{{ $item->member->full_name }}</td><td class="p-4">{{ $item->group->name }}</td><td class="p-4">₦{{ number_format($item->amount_paid/100,2) }} / ₦{{ number_format($item->amount_due/100,2) }}</td><td class="p-4"><span class="rounded-full bg-emerald-50 px-2 py-1 text-xs capitalize text-emerald-700">{{ $item->status->value }}</span></td><td class="p-4 text-right"><a class="text-emerald-600" href="{{ route('contributions.edit',$item) }}">Edit</a></td></tr>@empty<tr><td colspan="6" class="p-12 text-center text-slate-500">No contributions recorded.</td></tr>@endforelse</tbody></table></div></div>{{ $contributions->links() }}</div></x-app-layout>
