@extends('layouts.app') @section('content')
{{-- HEADER --}}

{{ __('Integrations') }}

{{ __('Selected business:') }} {{ session('selected_pos_note') ?: __('None') }}

@if (blank($selectedPosServiceId))
{{ __('No business is selected yet. Choose a branch from the Switch Business menu at the top-left — connections are listed for the selected business.') }}
@endif {{-- UNMAPPED EVENTS BADGE (Faz 5.5) --}} @if ($unmappedEvents > 0)
warning {{ __(':count webhook event(s) did not match any business (unknown store). Events were acknowledged with 200, no order was written.', ['count' => $unmappedEvents]) }}
@endif {{-- PLATFORM CARDS --}}
@foreach ($platforms as $platform)

{{ $platform['label'] }}

@if ($platform['integration']) {{ __('Connected') }} @else {{ __('Not Connected') }} @endif
@if ($platform['integration']) @php $expiresAt = $platform['integration']->token_expires_at; @endphp
{{ __('Registration Status') }}
{{ $platform['integration']->status ?? '-' }}
@if ($platform['credential_mode'] === 'oauth')
{{ __('Token') }}
{{ $expiresAt ? ($expiresAt->isFuture() ? __('Valid') : __('Expired')) : '-' }}
@endif
{{ __('Store') }}
@if ($platform['store_mapped']) {{ __('Matched') }} @else {{ __('Match Pending') }} @endif
@endif
@if ($platform['connect_route']) {{ $platform['integration'] ? __('Reconnect') : __('Connect') }} @else {{ __('Credentials will be entered manually (api_key).') }} @endif @if ($platform['integration'] && $platform['settings_route']) settings {{ __('Settings') }} @endif
@endforeach
@endsection