"use client"; import { useMemo } from "react"; import { AppShell } from "@/components/AppShell"; import type { ForeshadowView, ProjectResponse } from "@/lib/api/types"; import { LANES, groupByStatus, type ForeshadowStatus, } from "@/lib/foreshadow/board"; import { useForeshadow } from "@/lib/foreshadow/useForeshadow"; import { KanbanColumn } from "./KanbanColumn"; import { RegisterForm } from "./RegisterForm"; interface ForeshadowBoardProps { project: ProjectResponse; initialItems: ForeshadowView[]; } // 伏笔看板主体(UX §6.8):四泳道 + 登记/状态变更交互。 // RSC 取全量种入;Client 承载登记/转移(乐观 + 回滚 + Toast)。 export function ForeshadowBoard({ project, initialItems, }: ForeshadowBoardProps) { const { items, busy, register, transition } = useForeshadow(initialItems); const lanes = useMemo(() => groupByStatus(items), [items]); const onTransition = ( code: string, toStatus: ForeshadowStatus | null, progressNote: string, ): void => { void transition(code, { projectId: project.id, toStatus, progressEntry: progressNote ? { note: progressNote } : null, }); }; return (

伏笔看板

{LANES.map((status) => ( ))}
); }