import { PhoneIcon } from 'lucide-react' import { LeaderContactForm } from '@/components/campaign/leadership/LeaderContactForm' import type { RelationOption } from '@/components/campaign/shared/RelationMultiSelect' import { CampaignPageShell } from '@/components/campaign/shell/CampaignPageShell' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/Table' import { formatBrazilianPhoneInput } from '@/lib/phone' import type { LeaderContactListItem } from '@/utilities/leaderContactsPageData' const dateFormatter = new Intl.DateTimeFormat('pt-BR', { dateStyle: 'short', timeStyle: 'short', }) type LeaderContactsPanelProps = { municipalityOptions: RelationOption[] defaultMunicipalityId: number | null showMunicipalitySelect: boolean registrationConsentConfigured: boolean contacts: LeaderContactListItem[] } const LeaderContactsList = ({ contacts }: { contacts: LeaderContactListItem[] }) => (

Meus contatos ({contacts.length})

{contacts.length ? (
Nome Celular Município Cadastro {contacts.map((contact) => (
{contact.name} {contact.city ? ( {contact.city} ) : null}
{contact.phone ? ( ) : ( — )} {contact.municipalityName ?? '—'} {dateFormatter.format(new Date(contact.createdAt))}
))}
) : (

Você ainda não cadastrou nenhum contato. Use o formulário acima para começar.

)}
) /** * Leader home (lockdown role). Server component: the header and the contacts * table render on the server; only the registration form hydrates * (`LeaderContactForm` is the client island). */ export const LeaderContactsPanel = ({ municipalityOptions, defaultMunicipalityId, showMunicipalitySelect, registrationConsentConfigured, contacts, }: LeaderContactsPanelProps) => ( {municipalityOptions.length === 0 ? (

Você ainda não está vinculada a nenhum município. Fale com a assessoria da campanha.

) : ( )}
)