'use client'; import Link from 'next/link'; import { t } from '@/i18n'; import { cn } from '@/lib/cn'; import { displayValue, formatPeriod } from '@/lib/format'; import { routes } from '@/lib/site'; import type { MetricValue } from '@/lib/types'; import { ChangeChip } from '@/components/data/change-chip'; import { payloadFor, type MetricCountry } from '@/components/data/metric'; import { useProvenance } from '@/components/data/provenance-context'; import { RankBadge } from '@/components/data/rank-badge'; /** * Latest values of a subtopic, shown while its charts are collapsed on a long topic page: name · value · period * (highlighted when ≥ 2 years older than the newest value of the block) · change · world rank. Value → provenance. */ export function TopicCompact({ rows, country, regionName }: { rows: MetricValue[]; country: MetricCountry; regionName?: string | null }) { const { open } = useProvenance(); const latestYear = Math.max(0, ...rows.map((m) => m.year ?? 0)); return (

{t('topic.collapsedHint')}

); }