ai写作
This commit is contained in:
1 parent
cc8703577d
commit
10d7190ea4
12 files changed
+643
-43
No files matched your search
@@ -10,9 +10,10 @@ interface TimelineStepProps {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
function statusOf(event: ProgressEvent): StepStatus {
|
||||
function statusOf(event: ProgressEvent, isLast: boolean): StepStatus {
|
||||
if (event.type === 'await_user') return 'paused';
|
||||
if (event.type === 'step_start') return 'running';
|
||||
// step_start 只有在列表末尾(后续事件还未到达)时才显示转圈,否则已有后续事件说明该步骤已完成
|
||||
if (event.type === 'step_start') return isLast ? 'running' : 'done';
|
||||
return 'done';
|
||||
}
|
||||
|
||||
@@ -24,7 +25,7 @@ const AGENT_COLOR: Record<string, string> = {
|
||||
};
|
||||
|
||||
export function TimelineStep({ event, isLast, children }: TimelineStepProps) {
|
||||
const status = statusOf(event);
|
||||
const status = statusOf(event, isLast ?? true);
|
||||
|
||||
return (
|
||||
<div className="flex gap-3">
|
||||
|
||||
Reference in new issue
Block a user