diff --git a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx index 55ade6e5..c8e9a3f9 100644 --- a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx +++ b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx @@ -10,6 +10,7 @@ import { CampaignListResults, CampaignTransitionAnchor, } from '@/components/campaign/shared/CampaignListPending' +import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost' import { CampaignTable, CampaignTableHead, @@ -249,14 +250,18 @@ export default async function StateDeputiesPage({ searchParams }: StateDeputiesP

{sortSummary}

- row.id} - empty={} - /> + {/* One shared Drawer for every chip-cell sheet on coarse pointers + (miss #52 — never a Drawer root per opened cell). */} + + row.id} + empty={} + /> + {rows.length ? ( {sortSummary}

- row.id} - empty={} - /> + {/* One shared Drawer for every chip-cell sheet on coarse pointers + (miss #52 — never a Drawer root per opened cell). */} + + row.id} + empty={} + /> + {rows.length ? ( -
- {editing ? ( - - ) : ( - - )} - -
- - {showEmpty ? ( - - {!hasQuery ? ( - - ) : null} - - ) : ( -
- - - - Nome - E-mail - Celular - Municípios - - Ações - - - - - {draft ? ( - - - { - const name = event.currentTarget.value - setDraft((current) => (current ? { ...current, name } : current)) - }} - placeholder="Nome" - aria-label="Nome do novo assessor" - className={campaignInlineInputClassName} - autoFocus - /> - - - { - const email = event.currentTarget.value - setDraft((current) => (current ? { ...current, email } : current)) - }} - placeholder="E-mail" - aria-label="E-mail do novo assessor" - className={campaignInlineInputClassName} - /> - - - { - const phone = formatBrazilianPhoneInput( - sanitizeBrazilianPhoneInput(event.currentTarget.value), - ) - setDraft((current) => (current ? { ...current, phone } : current)) - }} - placeholder="Celular" - aria-label="Celular do novo assessor" - className={campaignInlineInputClassName} - /> - - - - setDraft((current) => (current ? { ...current, municipalityIds } : current)) - } - commitAction={municipalitiesAction} - drawerTitle="Carteira do assessor" - updateErrorMessage="Não foi possível atualizar a carteira." - /> - - -
- - -
-
+ ) : ( + + )} + + + + {showEmpty ? ( + + {!hasQuery ? ( + + ) : null} + + ) : ( +
+
+ + + Nome + E-mail + Celular + Municípios + + Ações + - ) : null} - - {rows.map((row) => { - const whatsAppHref = whatsAppHrefForPhone(row.phone) - const emailShown = displayEmail(row.email) - - return ( - + + + {draft ? ( + - {editing ? ( - - ) : ( - - {row.name} - - )} + { + const name = event.currentTarget.value + setDraft((current) => (current ? { ...current, name } : current)) + }} + placeholder="Nome" + aria-label="Nome do novo assessor" + className={campaignInlineInputClassName} + autoFocus + /> - {editing ? ( - - ) : ( - - )} + { + const email = event.currentTarget.value + setDraft((current) => (current ? { ...current, email } : current)) + }} + placeholder="E-mail" + aria-label="E-mail do novo assessor" + className={campaignInlineInputClassName} + /> - {editing ? ( - - ) : ( - - )} + { + const phone = formatBrazilianPhoneInput( + sanitizeBrazilianPhoneInput(event.currentTarget.value), + ) + setDraft((current) => (current ? { ...current, phone } : current)) + }} + placeholder="Celular" + aria-label="Celular do novo assessor" + className={campaignInlineInputClassName} + /> + setDraft((current) => + current ? { ...current, municipalityIds } : current, + ) + } commitAction={municipalitiesAction} drawerTitle="Carteira do assessor" updateErrorMessage="Não foi possível atualizar a carteira." @@ -379,45 +277,154 @@ export const AdvisorsTable = ({
- {whatsAppHref ? ( - - ) : ( - - )} - + +
- ) - })} -
-
-
- )} - + ) : null} + + {rows.map((row) => { + const whatsAppHref = whatsAppHrefForPhone(row.phone) + const emailShown = displayEmail(row.email) + + return ( + + + {editing ? ( + + ) : ( + + {row.name} + + )} + + + {editing ? ( + + ) : ( + + )} + + + {editing ? ( + + ) : ( + + )} + + + + + +
+ {whatsAppHref ? ( + + ) : ( + + )} + +
+
+
+ ) + })} + + + + )} + + ) }