File size: 1,424 Bytes
61fd574
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
function PipelineFlow({ steps = [] }) {
  return (
    <div className="flex-center" style={{ gap: 0, padding: '24px 0' }}>
      {steps.map((step, index) => {
        const isLast = index === steps.length - 1
        return (
          <div key={step.id} className="flex-center" style={{ gap: 0 }}>
            <div className="flex flex-col flex-center" style={{ gap: 8 }}>
              <div
                className={`pipeline-node pipeline-node-${step.status}`}
              >
                {step.status === 'completed' && '✓'}
                {step.status === 'error' && '❗'}
                {(step.status === 'idle' || step.status === 'running') && (
                  <span className={step.status === 'running' ? 'pipeline-step-running' : ''}>
                    {step.icon || '○'}
                  </span>
                )}
              </div>
              <span className={`text-sm pipeline-label-${step.status}`}>
                {step.label}
              </span>
              {step.status === 'error' && (
                <span className="text-sm text-error">暂不可用</span>
              )}
            </div>
            {!isLast && (
              <div
                className={`pipeline-connector pipeline-connector-${step.status === 'completed' ? 'completed' : 'idle'}`}
              />
            )}
          </div>
        )
      })}
    </div>
  )
}

export default PipelineFlow