import Link from 'next/link' import { CheckCircle2Icon, PlusIcon, UserRoundIcon } from 'lucide-react' import { createLeadershipFormAction, updateLeadershipFormAction, } from '@/app/(campaign)/campanha/(app)/nucleos/[slug]/leadershipFormActions' import { CampaignSearchInput } from '@/components/campaign/CampaignSearchInput' import { LeadershipDetail } from '@/components/campaign/LeadershipDetail' import { LeadershipFormLazy } from '@/components/campaign/LeadershipFormLazy' import { LeadershipList } from '@/components/campaign/LeadershipList' import { LeadershipPanelIsland } from '@/components/campaign/LeadershipPanelIsland' import { Badge } from '@/components/ui/Badge' import { Button } from '@/components/ui/button' import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@/components/ui/Empty' import { Field, FieldGroup, FieldLabel } from '@/components/ui/field' import { NativeSelect, NativeSelectOption } from '@/components/ui/native-select' import { Pagination, PaginationContent, PaginationItem, PaginationNext, PaginationPrevious, } from '@/components/ui/Pagination' import { buildLeadershipFilterHref, buildLeadershipPanelHref, formatLeadershipPhone, getLeadershipPanelFocusTargetId, leadershipSectorLabels, type LeadershipFilterState, type LeadershipPanelState, } from '@/utilities/leadershipUi' import { toLeadershipEditViewModel, type LeadershipSelfViewModel, type LeadershipStaffViewModel, type SelfLeadershipPageData, type StaffLeadershipPageData, } from '@/utilities/leadershipViewModels' const LeadershipSelfProfile = ({ leaderships }: { leaderships: LeadershipSelfViewModel[] }) => { const leadership = leaderships[0] if (!leadership) { return ( Sua ficha não está disponível Peça à coordenação para revisar seu vínculo com este núcleo. ) } return (

Sua ficha

{leadership.confirmedByPerson ? ( ) : null}
Nome
{leadership.name}
Celular
{formatLeadershipPhone(leadership.phone)}
Setor
{leadership.sector ? leadershipSectorLabels[leadership.sector] : 'Não informado'}
E-mail
{leadership.email ?? 'Não informado'}
) } const LeadershipFilters = ({ filters }: { filters: LeadershipFilterState }) => (
Status de apoio Todos os status Engajados A abordar Em disputa Negativos Setor Todos os setores {Object.entries(leadershipSectorLabels).map(([value, label]) => ( {label} ))}
) export const LeadershipNetwork = ({ filters, inviteConsentConfigured, nucleusId, nucleusSlug, pageData, panelState, primaryContactId, selectedLeadership, }: { filters: LeadershipFilterState inviteConsentConfigured: boolean nucleusId: number nucleusSlug: string pageData: StaffLeadershipPageData | SelfLeadershipPageData panelState: LeadershipPanelState primaryContactId: number | null selectedLeadership: LeadershipStaffViewModel | null }) => { if (pageData.kind === 'self') { return } const closeHref = buildLeadershipPanelHref(nucleusSlug, filters, { mode: 'closed' }) const panel = panelState.mode === 'closed' ? null : panelState.mode === 'create' ? { title: 'Nova liderança', description: 'Cadastre uma pessoa na rede deste núcleo.', focusTargetId: undefined, content: ( ), } : selectedLeadership ? { title: panelState.mode === 'edit' ? `Editar ${selectedLeadership.name}` : selectedLeadership.name, description: panelState.mode === 'edit' ? 'Atualize setor e avaliação interna.' : 'Contato e vínculo com este núcleo.', focusTargetId: getLeadershipPanelFocusTargetId(selectedLeadership.id), content: panelState.mode === 'edit' ? ( ) : ( ), } : null return (

{pageData.totalDocs} {pageData.totalDocs === 1 ? 'liderança' : 'lideranças'} {pageData.totalPages > 1 ? ` · página ${pageData.page} de ${pageData.totalPages}` : null}

{pageData.totalPages > 1 ? ( {pageData.page > 1 ? ( ) : null} {pageData.page < pageData.totalPages ? ( ) : null} ) : null} {panel ? ( {panel.content} ) : null}
) }