import { useGameStore } from '../store' import { computeUrgency } from '../../game/engine/kernel/urgency' export function UrgentBadges() { const world = useGameStore((s) => s.world) const revision = useGameStore((s) => s.revision) const setPanel = useGameStore((s) => s.setPanel) const setSpeed = useGameStore((s) => s.setSpeed) void revision if (!world) return null const u = computeUrgency(world) const items: { key: string; label: string; cls: string; onClick: () => void }[] = [] if (u.blockedCount > 0) items.push({ key: 'block', label: `瓶颈·${u.blockedCount}`, cls: 'badge-safe', onClick: () => { setPanel('family') } }) if (u.injuredCount > 0) items.push({ key: 'inj', label: `重伤·${u.injuredCount}`, cls: 'badge-bad', onClick: () => setPanel('family') }) if (u.missionCount > 0) items.push({ key: 'mis', label: `在外·${u.missionCount}`, cls: 'badge-info', onClick: () => setPanel('expedition') }) if (u.marriageReady >= 2) items.push({ key: 'mar', label: `媒缘·${u.marriageReady}`, cls: 'badge-warn', onClick: () => setPanel('family') }) if (u.noHeir) items.push({ key: 'heir', label: '孤嗣之忧', cls: 'badge-bad', onClick: () => setPanel('genealogy') }) if (items.length === 0) return null return (