import { ArrowRight, Activity, CheckCircle2, CircleHelp, Layers3 } from 'lucide-react' import { Link } from 'react-router-dom' import { Button } from '@/components/ui/button' import { Card, CardContent } from '@/components/ui/card' import { PageHeading, Panel, Empty, Reports, Status } from '@/components/shared' import { useWorkbench } from '@/lib/context' import { phaseLabels } from '@/lib/types' export default function Overview() { const { state } = useWorkbench() const pending = [...state.tasks.filter(t => t.decision), ...((state as { decisions?: { id: string; title: string; question: string; status: string }[] }).decisions || []).filter(d => ['open','needs_reconsideration'].includes(d.status)).map(d => ({ id: d.id, name: d.title, decision: d.question }))] const blocked = state.tasks.filter(t => ['blocked', 'failed'].includes(t.status)) const lead = state.tasks.find(t => t.id === 'WP0') const stats = [{ label: '工作包', value: state.tasks.length, icon: Layers3 }, { label: '进行中', value: state.tasks.filter(t => t.status === 'running').length, icon: Activity }, { label: '已完成', value: state.tasks.filter(t => t.status === 'completed').length, icon: CheckCircle2 }, { label: '待决定', value: pending.length, icon: CircleHelp }] return
询问进度 } />
{stats.map(s =>

{s.label}

{s.value}

)}
{lead ?
{phaseLabels[lead.phase] || lead.phase}
: 尚未登记总控阶段。}{blocked.length ?
{blocked.slice(0, 3).map(t =>

{t.id} · {t.name}

)}
:

当前没有登记受阻任务。

}
{pending.length ?
{pending.slice(0, 3).map(t =>

{t.id} · {t.name}

{t.decision}

)}
: 当前没有登记待决策事项。}
{state.hooks &&

活动故障 {state.hooks.active_firing} · 待投递通知 {state.hooks.pending_notifications}

} /report|summary|handoff/.test(e.kind)).slice(0, 3)} compact />
}