ERP-node/frontend/components/dataflow/connection/redesigned/RightPanel/StepProgress.tsx

58 lines
2.1 KiB
TypeScript
Raw Normal View History

"use client";
import React from "react";
2025-10-01 16:15:53 +09:00
import { Check, ArrowRight } from "lucide-react";
2025-10-01 16:15:53 +09:00
interface StepProgressProps {
currentStep: 1 | 2 | 3;
onStepChange: (step: 1 | 2 | 3) => void;
}
2025-10-01 16:15:53 +09:00
const steps = [
{ id: 1, title: "연결 선택", description: "FROM/TO 연결 설정" },
{ id: 2, title: "테이블 선택", description: "소스/타겟 테이블 선택" },
{ id: 3, title: "필드 매핑", description: "시각적 필드 매핑" },
];
export const StepProgress: React.FC<StepProgressProps> = ({ currentStep, onStepChange }) => {
return (
<div className="border-b border-gray-200 bg-white px-6 py-4">
2025-10-01 16:15:53 +09:00
<div className="flex items-center justify-between">
{steps.map((step, index) => (
<React.Fragment key={step.id}>
<div
className={`flex cursor-pointer items-center gap-3 transition-all duration-200 ${
2025-10-01 16:15:53 +09:00
step.id <= currentStep ? "opacity-100" : "opacity-50"
}`}
2025-10-01 16:15:53 +09:00
onClick={() => step.id <= currentStep && onStepChange(step.id as 1 | 2 | 3)}
>
2025-10-01 16:15:53 +09:00
<div
className={`flex h-8 w-8 items-center justify-center rounded-full text-sm font-medium transition-all duration-200 ${
2025-10-01 16:15:53 +09:00
step.id < currentStep
? "bg-green-500 text-white"
: step.id === currentStep
? "bg-orange-500 text-white"
: "text-muted-foreground bg-gray-200"
2025-10-01 16:15:53 +09:00
}`}
>
{step.id < currentStep ? <Check className="h-4 w-4" /> : step.id}
2025-10-01 16:15:53 +09:00
</div>
2025-10-01 16:15:53 +09:00
<div>
<h3 className={`text-sm font-medium ${step.id <= currentStep ? "text-gray-900" : "text-gray-500"}`}>
{step.title}
2025-10-01 16:15:53 +09:00
</h3>
<p className={`text-xs ${step.id <= currentStep ? "text-muted-foreground" : "text-gray-400"}`}>
2025-10-01 16:15:53 +09:00
{step.description}
</p>
</div>
2025-10-01 16:15:53 +09:00
</div>
{index < steps.length - 1 && <ArrowRight className="mx-4 h-4 w-4 text-gray-400" />}
2025-10-01 16:15:53 +09:00
</React.Fragment>
))}
</div>
</div>
);
};