Spaces:
Runtime error
Runtime error
Download frontend-react/src/components/workflow/PlanHeader.jsx from Amitkasar/ai-api-testing: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/spaces/Amitkasar/ai-api-testing/resolve/main/frontend-react/src/components/workflow/PlanHeader.jsx
- Command line
-
hf download hf://spaces/Amitkasar/ai-api-testing/frontend-react/src/components/workflow/PlanHeader.jsx
-
curl -L -o PlanHeader.jsx https://huggingface.co/spaces/Amitkasar/ai-api-testing/resolve/main/frontend-react/src/components/workflow/PlanHeader.jsx
1.88 kB
| import React from 'react'; | |
| import { RefreshCw, Zap, Download } from 'lucide-react'; | |
| export default function PlanHeader({ | |
| executionPlan, stepResults, | |
| isRunningAll, executingStep, | |
| onRunAll, onReset, onExport, | |
| }) { | |
| const successCount = Object.values(stepResults).filter(r => r.analysis?.status === 'success').length; | |
| const pct = executionPlan.length > 0 | |
| ? Math.round((successCount / executionPlan.length) * 100) | |
| : 0; | |
| return ( | |
| <div className="plan-meta"> | |
| <div> | |
| <div className="h-eyebrow">Execution plan</div> | |
| <div style={{ display: 'flex', alignItems: 'baseline', gap: 10, marginTop: 2 }}> | |
| <span style={{ fontSize: 15, fontWeight: 600, color: 'var(--fg-0)' }}>{executionPlan.length} steps</span> | |
| </div> | |
| </div> | |
| <div className="grow"/> | |
| <div style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: 12, color: 'var(--fg-2)' }}> | |
| <span style={{ width: 6, height: 6, borderRadius: '50%', background: 'var(--ok)', display: 'inline-block' }}/> | |
| {successCount} | |
| <span style={{ color: 'var(--fg-3)' }}>/ {executionPlan.length} ok</span> | |
| </div> | |
| <div className="progress"> | |
| <i style={{ width: `${pct}%` }}/> | |
| </div> | |
| {onExport && ( | |
| <button className="btn" onClick={onExport} title="Export as Postman Collection"> | |
| <Download size={13}/> Export | |
| </button> | |
| )} | |
| <button className="btn" onClick={onReset}> | |
| <RefreshCw size={13}/> Reset | |
| </button> | |
| <button | |
| className="btn btn-primary" | |
| onClick={onRunAll} | |
| disabled={isRunningAll || !!executingStep} | |
| style={{ gap: 6 }} | |
| > | |
| {isRunningAll | |
| ? <><RefreshCw size={13} style={{ animation: 'spin 1s linear infinite' }}/> Running…</> | |
| : <><Zap size={13}/> Run all</>} | |
| </button> | |
| </div> | |
| ); | |
| } | |