{{-- Header — same shape as the Template library header. --}}

{{ __('Email templates') }}

{{ __('Drag-and-drop builder · reusable in campaigns & flows') }}
{{ __('New template') }}
@if (session('status'))
{{ session('status') }}
@endif @if ($templates->isEmpty())
{{ __('No email templates yet') }}

{{ __('Build a reusable email with the drag-and-drop editor, then send it from an email campaign or flow.') }}

{{ __('Create your first template') }}
@else {{-- Same card grid as the Template library. --}}
@foreach ($templates as $tpl)
{{-- Header: name + channel badge (mirrors the WhatsApp card). --}}
{{ $tpl->name }} {{ __('Email') }}
{{ __('HTML email') }} {{ __('Ready') }} @if (trim((string) $tpl->subject) !== '') · {{ $tpl->subject }} @endif
{{-- Preview — the rendered email, scaled to FILL the box width (JS/ResizeObserver), cropped, in a sandboxed iframe so its CSS can't leak. This is the email equivalent of the chat-bubble mockup on the WhatsApp card. --}}
{{-- Footer: Edit (dashed pill, flex-1) + Delete (icon) — same as /templates. --}}
{{ __('Edit template') }}
@csrf @method('DELETE')
@endforeach
@endif