<x-app-layout title="Channels">
    <div class="mx-auto max-w-2xl">
        <div class="flex items-center justify-between">
            <div>
                <h1 class="text-xl font-semibold text-slate-900">Team channels</h1>
                <p class="mt-1 text-sm text-slate-600">Persistent chat for {{ $organization->name }}</p>
            </div>
            <a href="{{ route('meet.channels.create') }}" class="btn-primary">New channel</a>
        </div>

        <ul class="mt-6 divide-y divide-slate-100 rounded-2xl border border-slate-200 bg-white">
            @forelse ($channels as $channel)
                <li>
                    <a href="{{ route('meet.channels.show', $channel) }}" class="flex items-center justify-between px-6 py-4 hover:bg-slate-50">
                        <div>
                            <p class="font-medium text-slate-900"># {{ $channel->name }}</p>
                            <p class="text-sm text-slate-500">{{ ucfirst($channel->visibility) }}</p>
                        </div>
                        <span class="text-xs text-slate-400">{{ $channel->messages_count ?? '' }}</span>
                    </a>
                </li>
            @empty
                <li class="px-6 py-8 text-center text-slate-500">No channels yet. Create one for your team.</li>
            @endforelse
        </ul>
    </div>
</x-app-layout>
