{{-- Search --}}
{{-- Skeleton while Livewire loads --}}
@for ($i = 0; $i < 5; $i++)
@endfor
{{-- List --}}
@if ($contacts->isEmpty())

No contacts found.

@else @foreach ($contacts as $c) @php $name = $c['name'] ?? ''; $type = $c['type'] ?? 'Client'; $email = $c['email'] ?? null; $phone = $c['phone'] ?? null; // tel: normalize (allow +, digits) $tel = $phone ? ('tel:' . preg_replace('/(?!^\+)[^\d]/', '', $phone)) : null; // wa.me wants digits only + country code $waDigits = $phone ? preg_replace('/\D/', '', $phone) : null; $wa = $waDigits ? "https://wa.me/{$waDigits}" : null; $initials = collect(preg_split('/\s+/', trim($name)))->filter()->take(2)->map(fn($p) => mb_strtoupper(mb_substr($p, 0, 1)))->join(''); if ($initials === '') $initials = '??'; @endphp
{{ $initials }}

{{ $name }}

{{ $type }}

{{ $email ?: '—' }}

{{ $phone ?: '—' }}

@if ($tel) Call @else @endif @if ($wa) WhatsApp @else @endif
@endforeach @endif
{{-- Floating Action Button --}} {{-- Modal --}} @if($modalOpen)

New Contact

@error('first_name')

{{ $message }}

@enderror @error('last_name')

{{ $message }}

@enderror @error('email')

{{ $message }}

@enderror @error('phone')

{{ $message }}

@enderror
@endif