import Link from 'next/link' import type { ComponentProps, ReactNode } from 'react' import { CampaignInfoHint } from '@/components/campaign/shared/CampaignInfoHint' import { SuggestionCard, type SuggestionCardData, } from '@/components/campaign/suggestion/SuggestionCard' import { Button } from '@/components/ui/button' import { CAMPAIGN_CONCEPTS_PATH, campaignConceptHref } from '@/lib/campaignIntelligenceConcepts' import { SUGGESTION_STATUTE } from '@/lib/suggestionCatalog' import { formatSilenceAgeLabel } from '@/utilities/municipality/municipalitySignal' import type { MunicipalitySilenceEntry } from '@/utilities/municipality/municipalityTriggers' /** * E11 — the suggestion queue as a panel: triage-ordered cards, each a * data→decision pattern with its menu, plus the statute line that keeps the * catalog honest (§6: menu for judgment, never a rule). Server component; the * cards are the interactive islands. */ export const SuggestionsPanel = ({ titleId, suggestions, activeCount, showMunicipality = false, resolveAction, emptyState, readOnly = false, children, }: { titleId: string suggestions: readonly SuggestionCardData[] /** Total triggered in scope — the header says when the list below is a cut. */ activeCount: number showMunicipality?: boolean resolveAction: ComponentProps['resolveAction'] emptyState: ReactNode /** C142 — read-only presentation (advisor with Edição `somente_leitura`): cards render without decision actions. */ readOnly?: boolean /** Dashboard appends the silence strip here. */ children?: ReactNode }) => (

Sugestões

O produto vigia os municípios e dispara os padrões dado→decisão do catálogo da campanha, ordenados pela triagem (nível 1 = estoque em risco; nível 5 = otimização). Cada card traz a leitura provável, os fatos observados e o menu de ações — do barato ao caro.

A decisão é sempre humana: aceitar, adiar ou descartar fica registrado para o backtest — inclusive a leitura alternativa de um descarte.

Como a triagem ordena a fila Todos os conceitos
{activeCount > 0 ? ( {suggestions.length < activeCount ? `${suggestions.length} de ${activeCount} ativas` : activeCount === 1 ? '1 ativa' : `${activeCount} ativas`} ) : null}
{suggestions.length ? ( ) : ( emptyState )} {children}

{SUGGESTION_STATUTE}

) /** * "Pauta do silêncio" (§6.4): the prioritized municípios where NOTHING fired * and nothing was recorded for a month. A list of questions, not of tasks — * each chip opens the município so the answer starts with the registry. */ export const SuggestionSilenceStrip = ({ entries, }: { entries: readonly MunicipalitySilenceEntry[] }) => { if (entries.length === 0) return null const shown = entries.slice(0, 6) return (

Pauta do silêncio

{entries.length === 1 ? '1 município' : `${entries.length} municípios`}

Priorizados sem nenhum gatilho e sem sinal há mais de um mês — silêncio é pergunta, não conforto. A resposta começa auditando o registro, nunca despachando agenda.

) }