@php
$state = $getState() ?? [];
$a = $state['account'] ?? null;
$m = $state['m'] ?? ['progress' => ['done' => 0, 'total' => 0], 'phases' => [], 'next' => null];
$done = $m['progress']['done'] ?? 0;
$total = max(1, $m['progress']['total'] ?? 1);
$pct = (int) round($done / $total * 100);
$status = $a->status ?? 'intake';
$statusColor = ['live' => '#16a34a', 'synced' => '#2563eb', 'resolved' => '#0891b2', 'intake' => '#6b7280'][$status] ?? '#6b7280';
$pad = '1.25rem';
@endphp
{{-- ── Yard header ── --}}
{{ $a->yard_name ?? 'Yard' }}
{{ $a->account_email ?? '—' }}
{{ $status }}
GPS account
{{ $a->account_code ?? '—' }}
Webhook
{{ ($a->webhook_configured ?? false) ? '✓ Configured' : 'Not configured' }}
Progress
{{ $done }} / {{ $total }} steps
@if(!empty($a->last_error))
{{ $a->last_error }}
@endif
{{-- ── Progress + Next ── --}}
Onboarding progress
{{ $done }} / {{ $total }}
@if(!empty($m['next']))
Next
{{ $m['next']['label'] }}
@if(!empty($m['next']['key']))
@endif
@else
✓ All onboarding steps complete.
@endif
{{-- ── Phases ── --}}
@foreach($m['phases'] as $phase)
{{ $phase['complete'] ? '✓' : $phase['number'] }}
{{ $phase['title'] }}
{{ $phase['done'] }}/{{ $phase['total'] }}
@foreach($phase['items'] as $it)
@php
$isDone = $it['status'] === 'done';
$icon = $isDone ? '✓' : ($it['status'] === 'pending' ? '○' : '–');
@endphp
{{ $icon }}
{{ $it['label'] }}
{{ $it['kind'] }}
{{ $it['detail'] }}
@endforeach
@if(!empty($phase['actions']) || !empty($phase['hint']))
@foreach($phase['actions'] as $action)
@endforeach
@if(!empty($phase['hint']))
{{ $phase['hint'] }}
@endif
@endif
@endforeach