Show shared-number badge in the treatment table and lead detail

This commit is contained in:
Gustavo
2026-07-31 12:22:36 -03:00
parent 1370b39cee
commit a6dce5c936
3 changed files with 37 additions and 0 deletions
+13
View File
@@ -438,9 +438,19 @@ const Tratamento = (() => {
if (checkedAt) detalhes.push(`Consultado em ${checkedAt}`);
return h('div', { class: 'whatsapp-verification' },
h('span', { class: `badge whatsapp-${status}` }, WHATSAPP_STATUS_LABELS[status] || status),
numeroCompartilhadoBadge(lead),
detalhes.length ? h('div', { class: 'sub' }, detalhes.join(' · ')) : null);
}
function numeroCompartilhadoBadge(lead) {
if (!lead.numero_compartilhado) return null;
const classe = lead.numero_compartilhado_liberado ? 'numero-compartilhado-liberado' : 'numero-compartilhado';
const texto = lead.numero_compartilhado_liberado
? `Compartilhado (liberado, ${lead.numero_compartilhado_total} leads)`
: `Número compartilhado (${lead.numero_compartilhado_total} leads)`;
return h('span', { class: `badge ${classe}` }, texto);
}
function produtoCell(produto, afinidade) {
if (!produto) return '—';
const label = AFINIDADE_TABELA_LABELS[afinidade];
@@ -526,6 +536,9 @@ const Tratamento = (() => {
linha('Status WhatsApp', WHATSAPP_STATUS_LABELS[lead.whatsapp_status] || lead.whatsapp_status || 'Não consultado'),
linha('Número WhatsApp confirmado', lead.whatsapp_numero_resolvido),
linha('WhatsApp consultado em', whatsappCheckedAt(lead.whatsapp_checked_at)),
linha('Número compartilhado com outro lead', lead.numero_compartilhado
? `${lead.numero_compartilhado_total} leads${lead.numero_compartilhado_liberado ? ' (liberado)' : ''}`
: 'Não'),
linha('Cidade/UF', `${lead.cidade}/${lead.uf}`),
linha('Endereço', lead.endereco),
linha('Nicho', lead.segmento_label || lead.segmento),