teqo-backup/src/components/campaign/shared/CampaignCellTooltip.tsx
Francisco Ignácio Fontoura Solla 0ef4ddac1d E10 /simplify: remove superficie morta, unifica o parser de enum repetivel e reusa o ranking A11
- campoVotes (sem leitor) e classification.fieldHeadroom (duplicava o fator field) removidos
- formatTerritorialClassWhy passa a ser mesmo a fonte unica do slice(0,2) e do fallback
  "sem serie", eliminando o sentinela de string vazia nas duas superficies de detalhe
- classe territorial vira um so componente com layout table|card, como os vizinhos
- parseExhaustiveEnumParam em campaignListUrl cobre trend e class (o includes era morto:
  allParamValues ja deduplica)
- bloco central caminha o computeVoteRankByYear memoizado do A11 em vez de reordenar
  os 435 slugs por conta propria
- comentarios corrigidos onde afirmavam o contrario do codigo (CampaignCellTooltip e a
  regra do sem_base por superficie)
2026-07-25 22:33:16 -03:00

31 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client'
import type { ReactNode } from 'react'
import { CampaignHoverTooltip } from '@/components/campaign/shared/CampaignHoverTooltip'
/**
* Cell-level tooltip for the campaign list system — the render half of
* `CampaignTableColumn.cellTooltip`. Columns declare the extra reading; the
* table wraps the cell in this.
*
* The trigger `<span>` is created HERE rather than by the column, so a column
* declares only the data (`cellTooltip`) and the table owns the affordance —
* every cell tooltip in the system then behaves and is sized identically.
*
* It deliberately takes no `tabIndex` — 435 rows × N columns of dead tab stops
* would be a worse trade than the redundancy contract documented on
* `cellTooltip`, which requires the tooltip's information to already exist as
* text in the cell (visible or `sr-only`).
*/
export const CampaignCellTooltip = ({
content,
children,
}: {
content: ReactNode
children: ReactNode
}) => (
<CampaignHoverTooltip content={content} side="bottom" align="start">
<span className="inline-flex max-w-full">{children}</span>
</CampaignHoverTooltip>
)