-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathWorkflowRunGroup.tsx
More file actions
74 lines (70 loc) · 2.2 KB
/
Copy pathWorkflowRunGroup.tsx
File metadata and controls
74 lines (70 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { useNavigate } from 'react-router';
import { MessageSquare } from 'lucide-react';
import type { DashboardRunResponse } from '@/lib/api';
import { WorkflowRunCard } from './WorkflowRunCard';
interface WorkflowRunGroupProps {
parentPlatformId: string | null;
runs: DashboardRunResponse[];
isDocker?: boolean;
isWsl?: boolean;
wslDistro?: string;
onCancel: (runId: string) => void;
onResume?: (runId: string) => void;
onAbandon?: (runId: string) => void;
onDelete?: (runId: string) => void;
onApprove?: (runId: string) => void;
onReject?: (runId: string, reason?: string) => void;
}
export function WorkflowRunGroup({
parentPlatformId,
runs,
isDocker,
isWsl,
wslDistro,
onCancel,
onResume,
onAbandon,
onDelete,
onApprove,
onReject,
}: WorkflowRunGroupProps): React.ReactElement {
const navigate = useNavigate();
return (
<div className="space-y-2">
{/* Group header — only shown when there's a shared parent */}
{parentPlatformId && (
<div className="flex items-center gap-2 px-1">
<div className="h-px flex-1 bg-border" />
<button
onClick={(): void => {
navigate(`/chat/${encodeURIComponent(parentPlatformId)}`);
}}
className="flex items-center gap-1.5 rounded-full border border-border bg-surface-elevated px-2.5 py-0.5 text-[11px] text-text-secondary hover:border-primary/40 hover:text-primary transition-colors shrink-0"
>
<MessageSquare className="h-3 w-3" />
{runs.length} run{runs.length !== 1 ? 's' : ''} from this chat
</button>
<div className="h-px flex-1 bg-border" />
</div>
)}
{/* Cards for this group */}
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
{runs.map(run => (
<WorkflowRunCard
key={run.id}
run={run}
isDocker={isDocker}
isWsl={isWsl}
wslDistro={wslDistro}
onCancel={onCancel}
onResume={onResume}
onAbandon={onAbandon}
onDelete={onDelete}
onApprove={onApprove}
onReject={onReject}
/>
))}
</div>
</div>
);
}