RoundFrame.tsx 1.2 KB

1234567891011121314151617181920212223242526
  1. import { ChevronLeft, GitBranch } from "lucide-react";
  2. import type { NodeProps } from "@xyflow/react";
  3. import type { CanvasNodeData } from "@/lib/layout";
  4. import { StatusBadge } from "@/components/ui/Badges";
  5. export function RoundFrame({ data }: NodeProps) {
  6. const node = data as unknown as CanvasNodeData;
  7. const round = node.round;
  8. if (!round) return null;
  9. const defaultTitle = `第 ${round.roundIndex} 轮`;
  10. return <section className="roundFrame" aria-label={`第 ${round.roundIndex} 轮展开流程`}>
  11. <header>
  12. <button
  13. type="button"
  14. className="roundCollapse nodrag nopan"
  15. onClick={(event) => {
  16. event.stopPropagation();
  17. node.onToggleRound(round.roundIndex);
  18. }}
  19. ><ChevronLeft size={17} />折叠本轮</button>
  20. <div><strong>{round.summary.title && round.summary.title !== defaultTitle ? `${defaultTitle} · ${round.summary.title}` : defaultTitle}</strong><span>{round.summary.goal.headline || "本轮目标未记录"}</span></div>
  21. <span className="branchCount"><GitBranch size={13} />{round.branches.length} 个候选 · {round.convergenceBatches.length} 个收敛批次</span>
  22. <StatusBadge status={round.state} />
  23. </header>
  24. </section>;
  25. }