'use client' import type { ReactNode } from 'react' import { MunicipalityMobileCard } from '@/components/campaign/municipality/MunicipalityMobileCard' import type { MunicipalityStateDeputyCreateAction } from '@/components/campaign/shared/MunicipalityStateDeputyRelationCell' import type { AdvisorEditingScope } from '@/lib/campaignAdvisorProfile' import type { CampaignFormActionState } from '@/utilities/campaignFormActionError' import type { StateDeputyRelationOption } from '@/utilities/campaignRelationOptions' import type { EligibleAdvisorOption, EligibleLeadershipOption, MunicipalityAdvisorSummary, MunicipalityLeadershipSummary, MunicipalityListViewModel, } from '@/utilities/municipality/municipalityViewModels' type MunicipalityStaffFormAction = ( state: CampaignFormActionState, formData: FormData, ) => Promise export type MunicipalityListMobileCardsProps = { municipalities: MunicipalityListViewModel[] advisorNamesById: ReadonlyMap /** B155 — contact-name lookup for the Lideranças sheet chips. */ leadershipNamesById: ReadonlyMap isStaffView: boolean isCoordinator: boolean isCampaignUnrestricted: boolean canMoveEngagementLevel: boolean advisorOptions: EligibleAdvisorOption[] /** B155 — every leadership the actor may add, for the Lideranças sheet. */ leadershipOptions: EligibleLeadershipOption[] stateDeputyOptions: StateDeputyRelationOption[] stateDeputyCommitAction: MunicipalityStaffFormAction stateDeputyCreateAction: MunicipalityStateDeputyCreateAction signalFormAction: MunicipalityStaffFormAction emptySlot: ReactNode /** C142 — the UI write scope for the mobile card quick edits. */ editingScope: AdvisorEditingScope portfolioIDs: ReadonlySet | null } /** * B193 dense mobile cards with sheet-variant quick edits (edit-where-you-see). * Wrapped by `MunicipalityListMobileSection`, which hosts a single shared * Drawer. Each card is its own component so the "Última atualização" expansion * keeps per-card state. */ export const MunicipalityListMobileCards = ({ municipalities, advisorNamesById, leadershipNamesById, isStaffView, isCoordinator, isCampaignUnrestricted, canMoveEngagementLevel, advisorOptions, leadershipOptions, stateDeputyOptions, stateDeputyCommitAction, stateDeputyCreateAction, signalFormAction, emptySlot, editingScope, portfolioIDs, }: MunicipalityListMobileCardsProps) => (
{municipalities.length === 0 ? emptySlot : null} {municipalities.map((municipality) => ( ))}
)