@if (session('success'))
✅ {{ session('success') }}
@endif @if ($errors->has('calendar'))
⚠️ {{ $errors->first('calendar') }}
@endif
@foreach ($providers as $providerKey => $provider) @php $conn = $connections->get($providerKey); @endphp
{{-- NOTE: background is DYNAMIC — uses $provider['color'] --}}
{{ $provider['icon'] }}

{{ $provider['label'] }}

@if ($conn)

{{ $conn->external_account_email }}

@endif
@if ($conn) @php $statusColor = match ($conn->status) { 'active' => ['bg' => '#dcfce7', 'fg' => '#14532d', 'border' => '#bbf7d0'], 'needs_reauth' => ['bg' => '#fef3c7', 'fg' => '#78350f', 'border' => '#fde68a'], 'error' => ['bg' => '#fee2e2', 'fg' => '#7f1d1d', 'border' => '#fecaca'], 'disabled' => ['bg' => '#f3f4f6', 'fg' => '#374151', 'border' => '#e5e7eb'], default => ['bg' => '#f3f4f6', 'fg' => '#374151', 'border' => '#e5e7eb'], }; @endphp {{-- NOTE: bg/border/color are DYNAMIC — keyed on $conn->status --}}
{{ $statuses[$conn->status] ?? $conn->status }} @if ($conn->last_synced_at)
{{ __('filament/calendar_connections.last_synced', ['when' => $conn->last_synced_at->diffForHumans()]) }}
@endif @if ($conn->last_sync_error)
{{ \Illuminate\Support\Str::limit($conn->last_sync_error, 140) }}
@endif
@if ($conn->status === 'needs_reauth') {{ __('filament/calendar_connections.reconnect') }} @endif {{-- `data-confirm` is consumed by public/js/views/shared/confirm-form.js (declarative replacement for the legacy onsubmit handler). --}}
@csrf
@else

{{ __('filament/calendar_connections.not_connected_note', ['provider' => $provider['label']]) }}

@if ($provider['available']) {{-- NOTE: background is DYNAMIC — uses $provider['color'] --}} {{ __('filament/calendar_connections.connect_prefix') }} {{ $provider['label'] }} @else @endif @endif
@endforeach

{{ __('filament/calendar_connections.footnote') }}

{{-- Wires up `data-confirm` attributes on disconnect forms above. --}}