{{-- Scroll discipline mirrors the previous version — workspace layout owns the outer overflow; this section owns its own scroll so content past the fold stays reachable. --}}
@php $canManage = $this->canManage(); $defaultFlows = $this->defaultFlows(); $customByStore = $this->customFlowsByStore(); $storesUsingDefaults = $this->storesUsingDefaults(); $allStores = $this->allStores(); @endphp {{-- ─── Header ──────────────────────────────────────────────── --}}
{{ __('Self-help flows') }}

{{ __('Default flows ship to every store. Custom store flows override a default with the same slug on a specific store. Customers reach published flows at /self-help/{account}/{store}.') }}

@if ($canManage) {{ __('New flow') }} @endif
{{-- ─── Store summary ─────────────────────────────────────────── Owner/admin glance: which stores use the default set, which have custom flows. Shipped here rather than as a separate page so the operator can see at-a-glance + jump to copy actions. --}} @if ($allStores->count() > 0)
{{ __('Using default flows') }}
@forelse ($storesUsingDefaults as $store) {{ $store->name }} @empty {{ __('Every store has at least one custom flow.') }} @endforelse
{{ __('Stores with custom flows') }}
@forelse ($customByStore as $row) {{ $row['store']->name }} ({{ $row['flows']->count() }}) @empty {{ __('No store has custom flows yet.') }} @endforelse
@endif {{-- ─── DEFAULT FLOWS ───────────────────────────────────────── --}}
{{ __('Default flows') }}

{{ __('Account-wide templates. Surface on every store unless overridden by a same-slug store flow.') }}

@if ($defaultFlows->isEmpty())
{{ __('No default flows yet.') }}
@else @include('livewire.flows._index-flow-table', [ 'flows' => $defaultFlows, 'canManage' => $canManage, 'allStores' => $allStores, 'tableTestKey' => 'flows-default-list', ]) @endif
{{-- ─── CUSTOM STORE FLOWS ──────────────────────────────────── --}}
{{ __('Custom store flows') }}

{{ __('Per-store overrides + additions. A custom flow with the same slug as a default replaces the default on its store.') }}

@if ($customByStore->isEmpty())
{{ __('No store has custom flows yet. Use "Copy to store" on a default to promote one.') }}
@else @foreach ($customByStore as $row)
{{ $row['store']->name }} /{{ $row['store']->slug }}
@include('livewire.flows._index-flow-table', [ 'flows' => $row['flows'], 'canManage' => $canManage, 'allStores' => $allStores, 'tableTestKey' => 'flows-custom-list-'.$row['store']->id, ])
@endforeach @endif