import { ArrowRightIcon, CheckIcon, MinusIcon } from 'lucide-react' import Link from 'next/link' import { CampaignInfoHint } from '@/components/campaign/shared/CampaignInfoHint' import { CalendarPhaseNote } from '@/components/campaign/tour/CalendarPhaseNote' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/Alert' import { Button } from '@/components/ui/button' import { CAMPAIGN_CONCEPTS_PATH, campaignConceptHref } from '@/lib/campaignIntelligenceConcepts' import type { CalendarPhase } from '@/lib/visitPlannerAnchors' import { visitConditionLabels, visitContraindicationLabels, type VisitCondition, } from '@/utilities/visit/visitEligibility' import { buildTourComposerHref } from '@/utilities/visit/visitPlannerUrl' import type { VisitCandidateViewModel } from '@/utilities/visit/visitPlannerViews' /** * One condition of the checklist. The reason is ALWAYS visible text, never a * `title` attribute or a tooltip — E10's rule, for the same reason: a bare ✓/— * reads as a verdict, and a verdict nobody can audit is what makes the mesa * stop trusting the tool. */ const ConditionRow = ({ condition }: { condition: VisitCondition }) => (
  • {visitConditionLabels[condition.id]} {condition.met ? ': atendida' : ': não atendida'} {condition.detail}
  • ) /** * E13 — "vale a pena levar o candidato aqui?" as five conditions, never a * score (research report §6.4: a composite 0–100 buys false confidence that * the underlying data does not support). * * The count in the header is a count, not a grade: it says how many of the five * are clear, and every row below says which and why. A contraindication is an * ADVISORY with the counter-offer next to it — the coordination overrides it * whenever politics outweighs the numbers ("a geografia serve à política"). */ export const MunicipalityVisitEligibilityCard = ({ candidate, phase, }: { candidate: VisitCandidateViewModel phase: CalendarPhase }) => { const { eligibility } = candidate const contraindication = eligibility.contraindication return (

    Elegibilidade para visita

    A visita vale o que a rede local converte dela — por isso a leitura é uma{' '} checklist de cinco condições, e não uma nota. Exigir as cinco é o critério; o número no topo só diz quantas estão claras.

    O aviso de contraindicação nunca bloqueia: a coordenação decide contra ele quando a política pede.

    Como cada condição é avaliada Todos os conceitos
    {eligibility.metCount} de {eligibility.conditions.length} condições
    {contraindication ? ( {visitContraindicationLabels[contraindication.id]} {contraindication.reason} {contraindication.counterOffer} ) : null}
    ) }