@extends('layouts.student')
@section('title', 'My Clubs')
@section('content')
    <x-page-head title="My Clubs" subtitle="Groups & discussions" />
    <x-panel>
        @if ($clubs->isEmpty())
            <x-empty-state title="No clubs yet" message="Ask your teacher or registrar to assign you to a club." />
        @else
            <div class="table-wrap"><table><thead><tr><th>Club</th><th>Category</th><th>Patron</th><th>Members</th><th></th></tr></thead><tbody>
                @foreach ($clubs as $club)
                    <tr>
                        <td>{{ $club->name }}</td>
                        <td>{{ ucfirst($club->category ?? '—') }}</td>
                        <td>{{ $club->patron?->full_name ?? '—' }}</td>
                        <td>{{ $club->students_count }}</td>
                        <td class="text-right"><a href="{{ route('student.clubs.show', $club) }}" class="btn btn-primary btn-sm">Open Chat</a></td>
                    </tr>
                @endforeach
            </tbody></table></div>
        @endif
    </x-panel>
@endsection
