import { ArrowRight, CheckCircle2, CircleAlert, Clock3 } from "lucide-react";
import { Link } from "react-router";
import { WorkspaceState } from "@/components/layout/workspace-state";
import { projectAttentionCount, projectContinueTarget, projectDetailStage, projectNextActions, projectUnitStages, type ProjectStageCell, type ProjectWorkbenchAction } from "@/lib/project-workbench";
import { formatTime, type ProjectDetailViewProps } from "./shared";
export default function ProjectOverviewView({ detail }: ProjectDetailViewProps) {
const { project, units, canvases, shots } = detail;
const completedUnits = units.filter((unit) => unit.status === "completed").length;
const attentionCount = projectAttentionCount(detail);
const completion = units.length ? Math.round((completedUnits / units.length) * 100) : 0;
const stage = projectDetailStage(detail);
const actions = projectNextActions(detail, 3);
const primaryAction = actions[0];
const secondaryActions = actions.slice(1);
const continueTarget = projectContinueTarget(detail);
const unitStages = projectUnitStages(detail);
return (
当前任务
/
{stage.label}
{attentionCount ? {attentionCount} 项待处理 : null}
{primaryAction.title}
{primaryAction.description}
{primaryAction.actionLabel}
{continueTarget.href !== primaryAction.href ?
继续最近工作
: null}
制作流水线
章节进度
从内容确认到项目画布,每章只显示当前真实状态。
查看全部章节
{unitStages.length ? (
{unitStages.map((item) => (
{String(item.unit.position + 1).padStart(2, "0")}
{item.unit.title}更新于 {formatTime(item.unit.updatedAt)}
))}
) :
}
);
}
function ProjectFact({ label, value, attention = false }: { label: string; value: string; attention?: boolean }) {
return {label}{value};
}
function SecondaryAction({ action }: { action: ProjectWorkbenchAction }) {
const Icon = action.tone === "danger" ? CircleAlert : action.tone === "attention" ? Clock3 : CheckCircle2;
return {action.title};
}
function StagePipeline({ content, assets, storyboard, canvas }: { content: ProjectStageCell; assets: ProjectStageCell; storyboard: ProjectStageCell; canvas: ProjectStageCell }) {
const stages = [{ label: "内容", cell: content }, { label: "资产", cell: assets }, { label: "分镜", cell: storyboard }, { label: "画布", cell: canvas }];
return (
{stages.map(({ label, cell }) => )}
);
}
function StageStep({ label, cell }: { label: string; cell: ProjectStageCell }) {
const bar = cell.state === "completed" ? "bg-foreground/65" : cell.state === "attention" ? "bg-foreground/40" : cell.state === "active" ? "bg-[var(--workspace-accent)]" : "bg-foreground/10";
return (
{label}
{cell.label}
);
}