<div class="content-wrapper">
    <div class="container-xxl flex-grow-1 container-p-y">
        <div class="row">
            <div class="col">
                <div class="card shadow">
                    <div class="card-header bg-primary text-white fw-bold">
                        Other Income History - {{ $member->firstName }} {{ $member->lastName }}
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-sm table-striped table-bordered align-middle">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Date</th>
                                        <th>Income Type</th>
                                        <th>Amount</th>
                                        <th>Description</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @forelse($otherIncomes as $index => $income)
                                        <tr>
                                            <td>{{ $index + 1 }}</td>
                                            <td>{{ $income->created_at->format('Y-m-d') }}</td>
                                            <td>{{ $income->incomeType ?? '-' }}</td>
                                            <td>{{ number_format($income->amount, 2) }}</td>
                                            <td>{{ $income->description ?? '-' }}</td>
                                        </tr>
                                    @empty
                                        <tr>
                                            <td colspan="5" class="text-center">No Other Income Records Found</td>
                                        </tr>
                                    @endforelse
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
