"use client"; import { ArrowLeft, ClipboardList, FileText, MessageSquarePlus, Square } from "lucide-react"; import type { PagePhase } from "@/report-collaboration/state/selectors"; /** 计划模式覆盖的阶段:第一条消息起到工作流确认执行前。 */ const PLAN_MODE_PHASES = new Set(["clarifying", "planning", "proposal_ready"]); const PHASE_BADGES: Record = { empty: { label: "新会话", color: "var(--rc-text-secondary)", bg: "transparent" }, clarifying: { label: "澄清需求", color: "var(--rc-waiting)", bg: "rgba(217, 119, 6, 0.1)" }, planning: { label: "生成方案", color: "var(--rc-running)", bg: "rgba(37, 99, 235, 0.1)" }, proposal_ready: { label: "待确认方案", color: "var(--rc-accent)", bg: "rgb(var(--rc-accent-rgb) / 10%)" }, running: { label: "协作中", color: "var(--rc-running)", bg: "rgba(37, 99, 235, 0.1)" }, awaiting_input: { label: "等待输入", color: "var(--rc-waiting)", bg: "rgba(217, 119, 6, 0.1)" }, reviewing: { label: "审稿中", color: "var(--rc-running)", bg: "rgba(37, 99, 235, 0.1)" }, completed: { label: "已完成", color: "var(--rc-success)", bg: "rgba(22, 163, 74, 0.1)" }, failed: { label: "失败", color: "var(--rc-danger)", bg: "rgba(220, 38, 38, 0.1)" }, cancelled: { label: "已取消", color: "var(--rc-text-secondary)", bg: "transparent" }, }; interface ReportCollaborationHeaderProps { title: string; phase: PagePhase; onBack: () => void; onNewSession: () => void; onOpenReport: () => void; hasReport: boolean; running: boolean; onCancelRun: () => void; extra?: React.ReactNode; } /** 顶栏:返回 / 标题+状态 / 报告 / 停止 / 新建(右侧由布局注入窄屏切换等)。 */ export function ReportCollaborationHeader({ title, phase, onBack, onNewSession, onOpenReport, hasReport, running, onCancelRun, extra, }: ReportCollaborationHeaderProps) { const badge = PHASE_BADGES[phase] ?? PHASE_BADGES.empty; return (
报告协作 / {title} {PLAN_MODE_PHASES.has(phase) ? ( 计划模式 ) : null} {badge.label}
{extra} {running ? ( ) : null}
); }