{{-- Page header --}}

{{ __('Integrations') }}

{{ __('Connect third-party tools and services to extend') }} {{ config('app.name') }}.

{{-- Flash / status message --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Inline status message (from sync/test operations) --}} @if($statusMessage && !$configuringService)
@if($statusType === 'success') @elseif($statusType === 'error') @else @endif {{ $statusMessage }}
@endif {{-- Integration cards grid --}}
@foreach($integrations as $key => $int)
{{-- Icon --}}
{{ substr($int['name'], 0, 2) }}
{{-- Info --}}

{{ $int['name'] }}

{{ $int['category'] }}

{{ $int['description'] }}

@if($int['status'] === 'active' && $int['account_name'])

{{ $int['account_name'] }}

@endif @if($int['status'] === 'error' && $int['error_message'])

{{ $int['error_message'] }}

@endif
@php // Demo-only integrations: we hide the per-service action // buttons (Sync Contacts, Sync Deals, Sync Contacts Now, // View Calendar) AND the generic Test button, so the card // only exposes a single Disconnect control while we're // running in UI-preview mode. $demoOnly = in_array($key, ['zapier', 'salesforce', 'hubspot', 'google_calendar'], true); @endphp {{-- Integration-specific action buttons (when connected) --}} @if($int['status'] === 'active' && ! $demoOnly)
@switch($key) @case('slack') @if($int['slack_channel_id']) {{ __('Channel:') }} {{ $int['slack_channel_id'] }} @endif @break @case('stripe') Payment Dashboard @break @case('hubspot') @break @case('salesforce') @break @case('google_calendar') View Calendar @break @endswitch
{{-- Last sync info --}} @if($int['last_sync_at'])

{{ __('Last sync:') }} {{ $int['last_sync_at'] }} @if($int['last_sync_stats']) · {{ $int['last_sync_stats']['synced'] ?? 0 }} {{ __('synced') }} @if(($int['last_sync_stats']['failed'] ?? 0) > 0) , {{ $int['last_sync_stats']['failed'] }} {{ __('failed') }} @endif @endif

@endif
@endif {{-- Footer --}}
{{-- Status indicator --}} {{ $int['status'] === 'active' ? 'Connected' : ($int['status'] === 'error' ? 'Error' : 'Not connected') }} @if($int['status'] === 'active' && $int['connected_at']) · {{ $int['connected_at'] }} @endif {{-- Action buttons --}}
@if($int['status'] === 'active') {{-- Test button (hidden for demo-only integrations so the fake credentials can't be probed). --}} @unless($demoOnly) @endunless {{-- Disconnect button --}} @elseif($int['status'] === 'error') @if($demoOnly) {{-- Demo-only integrations skip the Reconnect escape hatch — a fresh run of the fake connect script will flip them back to active, so the card only needs Disconnect. --}} @else {{-- Reconnect button --}} {{-- Disconnect button --}} @endif @else {{-- Connect button --}} @endif
@endforeach
{{-- ============================================================= --}} {{-- Configuration Modal --}} {{-- ============================================================= --}} @if($configuringService) @endif