{{-- Header --}}
{{ __('Workspace') }}: {{ $account->name }}
{{ __('Integrations') }} {{ __('Manage external connections used by ClearDesk-mode self-service and the inbox side panel. Credentials are encrypted at rest.') }}
@if ($this->canManage) {{ __('Add integration') }} @endif
{{-- List --}} @if ($this->integrations->isEmpty())
@if ($this->canManage) {{ __('No integrations yet. Use "Add integration" above to connect Helm or Shopify.') }} @else {{ __('No integrations are configured for this account yet.') }} @endif
@else
@foreach ($this->integrations as $integration) @php $providerValue = $integration->provider->value; $statusValue = $integration->status->value; $scopeLabel = $integration->store_id ? __('Store: :name', ['name' => $integration->store?->name ?? '—']) : __('Account-level'); $syncSummary = $this->syncSummaryFor($integration); @endphp
{{ ucfirst($providerValue) }} {{ $integration->name }} @if (! $integration->enabled) {{ __('Disabled') }} @endif
{{ $scopeLabel }} · {{ ucwords(str_replace('_', ' ', $statusValue)) }} @if ($integration->last_checked_at) · {{ __('Checked') }} {{ $integration->last_checked_at->diffForHumans() }} @endif
@if ($statusValue === 'error' && $integration->last_error)
{{ $integration->last_error }}
@endif
@if ($this->canManage) {{ __('Edit') }} @endif
{{-- Compact at-a-glance sync indicator for Shopify rows. Detailed controls (Start / Cancel / Reset / Process queue / Incremental) live on the Edit page. This keeps the index a clean list — operators click "Edit" to drill in. Both customers + orders pills render unconditionally so the strip looks consistent across rows. --}} @if ($providerValue === 'shopify' && $integration->enabled && $statusValue === 'configured' && is_array($syncSummary))
@foreach ($syncSummary as $type => $entry) {{ ucfirst($type) }}: {{ $entry['label'] }} @endforeach {{ __('Manage sync →') }}
@endif
@endforeach
@endif