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

70 lines
2.3 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: "시각적 필드 매핑" },
];
2025-10-01 16:15:53 +09:00
export const StepProgress: React.FC<StepProgressProps> = ({
currentStep,
onStepChange,
}) => {
return (
2025-10-01 16:15:53 +09:00
<div className="bg-white border-b border-gray-200 px-6 py-4">
<div className="flex items-center justify-between">
{steps.map((step, index) => (
<React.Fragment key={step.id}>
<div
className={`flex items-center gap-3 cursor-pointer transition-all duration-200 ${
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={`w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium transition-all duration-200 ${
step.id < currentStep
? "bg-green-500 text-white"
: step.id === currentStep
? "bg-orange-500 text-white"
: "bg-gray-200 text-muted-foreground"
2025-10-01 16:15:53 +09:00
}`}
>
{step.id < currentStep ? (
<Check className="w-4 h-4" />
) : (
step.id
)}
</div>
<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="w-4 h-4 text-gray-400 mx-4" />
)}
</React.Fragment>
))}
</div>
</div>
);
2025-10-01 16:15:53 +09:00
};