2025-09-26 01:28:51 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import React from "react";
|
2025-10-01 16:15:53 +09:00
|
|
|
import { Check, ArrowRight } from "lucide-react";
|
2025-09-26 01:28:51 +09:00
|
|
|
|
2025-10-01 16:15:53 +09:00
|
|
|
interface StepProgressProps {
|
|
|
|
|
currentStep: 1 | 2 | 3;
|
|
|
|
|
onStepChange: (step: 1 | 2 | 3) => void;
|
|
|
|
|
}
|
2025-09-26 01:28:51 +09:00
|
|
|
|
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-09-26 01:28:51 +09:00
|
|
|
|
2026-03-10 18:30:18 +09:00
|
|
|
export const StepProgress: React.FC<StepProgressProps> = ({ currentStep, onStepChange }) => {
|
2025-09-26 01:28:51 +09:00
|
|
|
return (
|
2026-03-10 18:30:18 +09:00
|
|
|
<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
|
2026-03-10 18:30:18 +09:00
|
|
|
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-09-26 01:28:51 +09:00
|
|
|
}`}
|
2025-10-01 16:15:53 +09:00
|
|
|
onClick={() => step.id <= currentStep && onStepChange(step.id as 1 | 2 | 3)}
|
2025-09-26 01:28:51 +09:00
|
|
|
>
|
2025-10-01 16:15:53 +09:00
|
|
|
<div
|
2026-03-10 18:30:18 +09:00
|
|
|
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
|
2026-03-10 18:30:18 +09:00
|
|
|
? "bg-orange-500 text-white"
|
|
|
|
|
: "text-muted-foreground bg-gray-200"
|
2025-10-01 16:15:53 +09:00
|
|
|
}`}
|
|
|
|
|
>
|
2026-03-10 18:30:18 +09:00
|
|
|
{step.id < currentStep ? <Check className="h-4 w-4" /> : step.id}
|
2025-10-01 16:15:53 +09:00
|
|
|
</div>
|
2026-03-10 18:30:18 +09:00
|
|
|
|
2025-10-01 16:15:53 +09:00
|
|
|
<div>
|
2026-03-10 18:30:18 +09:00
|
|
|
<h3 className={`text-sm font-medium ${step.id <= currentStep ? "text-gray-900" : "text-gray-500"}`}>
|
2025-09-26 01:28:51 +09:00
|
|
|
{step.title}
|
2025-10-01 16:15:53 +09:00
|
|
|
</h3>
|
2026-03-10 18:30:18 +09:00
|
|
|
<p className={`text-xs ${step.id <= currentStep ? "text-muted-foreground" : "text-gray-400"}`}>
|
2025-10-01 16:15:53 +09:00
|
|
|
{step.description}
|
|
|
|
|
</p>
|
2025-09-26 01:28:51 +09:00
|
|
|
</div>
|
2025-10-01 16:15:53 +09:00
|
|
|
</div>
|
2026-03-10 18:30:18 +09:00
|
|
|
|
|
|
|
|
{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>
|
2025-09-26 01:28:51 +09:00
|
|
|
</div>
|
|
|
|
|
);
|
2026-03-10 18:30:18 +09:00
|
|
|
};
|