@if ($partners->isEmpty())
    <p class="mb-0">No courseware partners yet.</p>
@else
    <div class="table-responsive">
        <table class="table table-responsive-md mb-0">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Status</th>
                    <th class="text-end">Action</th>
                </tr>
            </thead>
            <tbody>
                @foreach ($partners as $partner)
                    <tr>
                        <td>{{ $partner->applicant_name }}</td>
                        <td>{{ $partner->email }}</td>
                        <td>
                            @if ($partner->user)
                                <span class="badge {{ $partner->user->status->badgeClass() }}">{{ $partner->user->status->label() }}</span>
                            @else
                                —
                            @endif
                        </td>
                        <td class="text-end">
                            @can('view', $partner)
                                <a href="{{ route('courseware-partners.show', $partner) }}" class="btn btn-info btn-xs">View</a>
                            @endcan
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
    @if ($partners->hasPages())
        <div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mt-3 js-partners-pagination">
            <small class="text-muted">Showing {{ $partners->firstItem() }} to {{ $partners->lastItem() }} of {{ $partners->total() }}</small>
            {{ $partners->links() }}
        </div>
    @endif
@endif
