{{ __('Admin') }} {{ __('Flow templates') }}
{{ __('Admin · Automation · Templates') }}

{{ __('Bot Flow') }} {{ __('templates') }}.

{{ __('Build a standard flow once — a restaurant welcome, a lead qualifier — and every tenant can clone it into their workspace from the "Start from a template" gallery on Flows.') }}

@if (session('success'))
{{ session('success') }}
@endif {{-- KPI strip --}}
{{ __('Templates') }}
{{ number_format($stats['total'] ?? 0) }}
{{ __('total') }}
{{ __('Visible to tenants') }}
{{ number_format($stats['active'] ?? 0) }}
{{ __('active') }}
{{ __('Times cloned') }}
{{ number_format($stats['clones'] ?? 0) }}
{{ __('by tenants') }}
@php $typeBadge = [ 'chat' => ['Chat', 'bg-wa-mint text-wa-deep'], 'call' => ['Call', 'bg-accent-amber/15 text-[#7B5A14]'], 'instagram' => ['Instagram', 'bg-[#EFE5F5] text-[#5B3D8A]'], ]; @endphp
{{ __('Template') }}
{{ __('Type') }}
{{ __('Category') }}
{{ __('Steps') }}
{{ __('Clones') }}
{{ __('Actions') }}
@forelse ($templates as $t) @php $tb = $typeBadge[$t->flow_type] ?? ['—', 'bg-paper-100 text-ink-500']; @endphp
{{ $t->name }} @unless ($t->is_active) {{ __('hidden') }} @endunless
@if ($t->description)
{{ \Illuminate\Support\Str::limit($t->description, 90) }}
@endif
{{ $tb[0] }}
{{ $t->category ?: '—' }}
{{ $t->node_count }}
{{ number_format($t->clone_count) }}
@csrf
@csrf @method('DELETE')
@empty
{{ __('No templates yet') }}

{{ __('Build a flow in the builder, export it, then add it here — or paste its JSON. Active templates show up in every tenant\'s Flows page.') }}

{{ __('Add your first template') }}
@endforelse
@if ($templates->hasPages())
{{ $templates->links() }}
@endif