da53b6d175
CI/CD Pipeline / Check if frontend-only change (push) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (push) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (push) Has been cancelled
CI/CD Pipeline / Validate - Migration (alembic) (push) Has been cancelled
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (push) Has been cancelled
CI/CD Pipeline / PR Build API Image (push) Has been cancelled
CI/CD Pipeline / PR Build Web Image (push) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (push) Has been cancelled
CI/CD Pipeline / Build Staging API Image (push) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (push) Has been cancelled
CI/CD Pipeline / Build Staging Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
refactor: GeneratePage Phase 1 — 抽离常量/类型/UI组件(3036→2682行)
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
/**
|
||
* 智能剪辑步骤条组件
|
||
*/
|
||
import React from "react"
|
||
import { STEPS } from "../constants"
|
||
|
||
interface GenerateStepsBarProps {
|
||
/** 当前步骤(1-based) */
|
||
currentStep: number
|
||
/** 点击已完成步骤的回调(用于回退) */
|
||
onStepClick?: (step: number) => void
|
||
}
|
||
|
||
const GenerateStepsBar: React.FC<GenerateStepsBarProps> = ({ currentStep, onStepClick }) => {
|
||
return (
|
||
<div className="xx-steps-bar">
|
||
{STEPS.map((step, idx) => {
|
||
const isActive = currentStep === step.key
|
||
const isDone = currentStep > step.key
|
||
const cls = ["xx-step-item", isActive ? "active" : "", isDone ? "done" : ""]
|
||
.filter(Boolean)
|
||
.join(" ")
|
||
return (
|
||
<React.Fragment key={step.key}>
|
||
{idx > 0 && <span className="xx-step-arrow">→</span>}
|
||
<div
|
||
className={cls}
|
||
onClick={() => {
|
||
// 允许点击已完成的步骤回退
|
||
if (isDone && onStepClick) {
|
||
onStepClick(step.key)
|
||
}
|
||
}}
|
||
role="button"
|
||
tabIndex={0}
|
||
>
|
||
<div className="xx-step-num">{isDone ? "✓" : step.key}</div>
|
||
<span className="xx-step-label">{step.label}</span>
|
||
</div>
|
||
</React.Fragment>
|
||
)
|
||
})}
|
||
</div>
|
||
)
|
||
}
|
||
|
||
export default GenerateStepsBar
|