{{ $contactId ? __('Edit Contact') : __('New Contact') }}

@error('first_name')

{{ $message }}

@enderror
@error('last_name')

{{ $message }}

@enderror
@error('email')

{{ $message }}

@enderror
@error('phone')

{{ $message }}

@enderror
@error('company')

{{ $message }}

@enderror
@error('job_title')

{{ $message }}

@enderror
@error('city')

{{ $message }}

@enderror
@error('country')

{{ $message }}

@enderror
{{-- Tags — checkbox list of existing workspace tags + an inline "add new tag" input. The section now renders even when the workspace has zero tags yet, so the first contact you create on a fresh install can introduce the first tag without bouncing to Settings → Tags first. --}}
@if($this->tags->isNotEmpty())
@foreach($this->tags as $tag) @endforeach
@endif {{-- New tag input — typing a name + pressing Enter creates the tag in the workspace AND auto-selects it for this contact. addNewTag() is idempotent on case-insensitive duplicates so typing an existing tag just selects it. --}}
@error('newTagName')

{{ $message }}

@enderror

{{ __('Type a name and press Enter or click Add. New tags are saved instantly and selected for this contact.') }}

{{-- Custom fields — grouped by `group_name`. Ungrouped fields (group_name=null) render flat at the top, then each named group renders inside a collapsible
block. The input rendering itself lives in _custom-field-input so the grouped and ungrouped paths stay in sync. --}} @foreach($this->groupedCustomFields as $groupLabel => $groupFields) @if($groupLabel === '') @foreach($groupFields as $field) @include('livewire.contacts._custom-field-input', ['field' => $field]) @endforeach @else
{{ $groupLabel }}
@foreach($groupFields as $field) @include('livewire.contacts._custom-field-input', ['field' => $field]) @endforeach
@endif @endforeach