{{-- Toast --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Empty state if no email accounts connected yet --}} @if($accounts->isEmpty())

{{ __('No email accounts connected') }}

{{ __('Connect a Gmail, Outlook, or IMAP account to start using signatures.') }}

{{ __('Connect email account') }}
@else {{-- Account picker (only shown if more than one account) --}} @if($accounts->count() > 1)
@foreach($accounts as $acc) @endforeach
@endif {{-- Header with current account + Add button --}}

{{ __('Email Signatures') }}

{{ __('Auto-append a signature to emails sent from') }} {{ $accounts->firstWhere('id', $selectedAccountId)?->email ?? '—' }}

@if(!$showForm) @endif
{{-- Add / Edit form --}} @if($showForm)

{{ $editingId ? __('Edit signature') : __('New signature') }}

{{-- Signature name --}}
@error('signatureName')

{{ $message }}

@enderror
{{-- Rich-text editor (tiny inline toolbar over a contenteditable div) --}}
{{-- Toolbar --}}
{{-- Editor --}}
@error('contentHtml')

{{ $message }}

@enderror

{{ __('Tip: paste an HTML signature from your existing email client and it will render exactly as it does today.') }}

{{-- Toggles --}}
{{-- Form actions --}}
@endif {{-- Signature list --}} @if(!$showForm) @if($signatures->isEmpty())

{{ __('No signatures yet') }}

{{ __('Create one to auto-append it to every email this account sends.') }}

@else
@foreach($signatures as $sig)

{{ $sig->name }}

@if($sig->is_default) {{ __('Default') }} @endif
{{ __('New emails') }}: {{ $sig->append_to_new ? __('On') : __('Off') }} | {{ __('Replies') }}: {{ $sig->append_to_replies ? __('On') : __('Off') }}
@if(!$sig->is_default) @endif
{{-- Preview --}}
{{ __('Preview') }}
{!! $sig->content_html !!}
@endforeach
@endif @endif @endif