<li class="flex items-start gap-4 px-4 py-4 transition hover:bg-slate-50">
    <a
        href="{{ route('people.show', [
            'contact' => $item->contact->id,
            'conversa' => $item->conversation?->id,
        ]) }}"
        class="flex min-w-0 flex-1 items-start gap-4"
    >
        <div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-emerald-100 text-sm font-semibold text-emerald-800">
            {{ mb_strtoupper(mb_substr($item->contact->display_name ?: $item->contact->phone ?: '?', 0, 1)) }}
        </div>

        <div class="min-w-0 flex-1">
            <div class="flex flex-wrap items-center gap-2">
                <span class="font-semibold text-slate-900">
                    {{ $item->contact->display_name ?: $item->contact->phone ?: 'Pessoa' }}
                </span>
                <span class="rounded-full bg-sky-100 px-2 py-0.5 text-xs font-medium text-sky-800">
                    {{ $item->statusLabel }}
                </span>
                @if ($item->priorityScore > 0 && $item->section !== \ImovelZapAi\Conversations\Domain\Enums\InboxSection::Finalized)
                    <span class="rounded-full bg-amber-100 px-2 py-0.5 text-xs font-medium text-amber-800">
                        Prioridade {{ $item->priorityScore }}
                    </span>
                @endif
                @if ($item->requestedVisit)
                    <span class="rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-800">
                        Visita
                    </span>
                @endif
            </div>

            @if ($item->preview)
                <p class="mt-1 truncate text-sm text-slate-600">{{ $item->preview }}</p>
            @endif
        </div>
    </a>

    <div class="shrink-0 text-right">
        @if ($item->sortAt)
            <time class="text-xs text-slate-400" datetime="{{ $item->sortAt->toIso8601String() }}">
                {{ $item->sortAt->diffForHumans(short: true) }}
            </time>
        @endif

        @if ($item->handoff !== null)
            <form method="POST" action="{{ route('people.claim', $item->handoff) }}" class="mt-2">
                @csrf
                <button
                    type="submit"
                    class="rounded-lg bg-emerald-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-emerald-700"
                >
                    Assumir
                </button>
            </form>
        @endif
    </div>
</li>
