mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-19 08:03:06 +00:00
- Popover + NativeSelect sempre montado na coluna Status de /campanha/liderancas, sem toggle de modo de edição - Auto-save (~150ms) via POST /campanha/liderancas/support-status, reusando isSameOriginRequest/campaignJsonMutationRoute (B24/B27), sem revalidatePath - Extrai leadershipStaffEditSafeMessages (adotado também em liderancas/formActions.ts e nova/formActions.ts) e utilities/leadershipLabels.ts (3º call site de supportStatusLabels, agora fonte única também para SupportStatusBadge) - Novo e2e tests/e2e/campaignLeaderships.e2e.spec.ts; setup.e2e.spec.ts prewarma as rotas novas - Fecha o Adiado com gatilho do B29; docs/plans, notebook e roadmap atualizados Gate: tsc/lint/format/knip(P3 pré-existente)/check:cycles/unit+int/e2e verdes; two /simplify passes (labels/estado duplicado/isSupportStatus; flush-on-close ao fechar o popover, comentário órfão de summary/ campos summary mortos removidos de SupportStatusBadge).
24 lines
891 B
TypeScript
24 lines
891 B
TypeScript
import { Badge } from '@/components/ui/Badge'
|
|
import type { SupportStatus } from '@/lib/schemas/leadership'
|
|
import { supportStatusLabels } from '@/utilities/leadershipLabels'
|
|
|
|
export type { SupportStatus } from '@/lib/schemas/leadership'
|
|
|
|
// Labels live in `leadershipLabels.ts` (shared with the ficha forms and the
|
|
// list quick-edit control) — this table only adds the badge-specific variant.
|
|
const statusPresentation = {
|
|
engajado: { variant: 'support-engaged' },
|
|
a_abordar: { variant: 'support-to-approach' },
|
|
em_disputa: { variant: 'support-disputed' },
|
|
negativo: { variant: 'support-negative' },
|
|
} as const
|
|
|
|
export const SupportStatusBadge = ({ status }: { status: SupportStatus }) => {
|
|
const presentation = statusPresentation[status]
|
|
|
|
return (
|
|
<Badge variant={presentation.variant} data-support-status={status}>
|
|
{supportStatusLabels[status]}
|
|
</Badge>
|
|
)
|
|
}
|