{{-- Flash messages --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Header --}}

{{ __('Email Templates') }}

{{ __('Reusable templates for campaigns and inbox replies. Built with the same block editor as campaigns.') }}

{{-- "Create template" is a navigation, NOT a Livewire action, because the builder lives at its own route and mounts the existing App\Livewire\Campaigns\EmailBuilder there. --}} {{ __('Create template') }}
{{-- Filters --}}
{{-- Grid --}} @if($this->templates->isEmpty())

{{ __('No templates match. Try a different category, or click "Create template" above.') }}

@else
@foreach($this->templates as $template)
@if($template->thumbnail_path) {{ $template->name }} @else @endif

{{ $template->name }}

@if($template->workspace_id === null) {{ __('Platform') }} @endif

{{ $this->categories[$template->category] ?? $template->category }} @if($template->usage_count > 0) · {{ $template->usage_count }} {{ __('uses') }} @endif

@if($template->workspace_id !== null) {{-- Edit = navigate to the builder route with the template id; EmailBuilder::mount() loads it. --}} @endif @if($template->workspace_id !== null) @endif
@endforeach
@endif {{-- Preview modal --}} @if($previewId)

{{ __('Template preview') }}

{!! $this->previewHtml !!}
@endif