2025-03-29 16:50:39 +08:00
|
|
|
"use client"
|
|
|
|
|
|
|
|
|
|
import { cn } from "@/lib/utils"
|
2025-07-07 17:08:27 +08:00
|
|
|
import { useMobile } from "@/hooks/use-mobile"
|
|
|
|
|
|
|
|
|
|
interface Step {
|
|
|
|
|
number: number
|
|
|
|
|
title: string
|
|
|
|
|
}
|
2025-03-29 16:50:39 +08:00
|
|
|
|
|
|
|
|
interface StepIndicatorProps {
|
|
|
|
|
currentStep: number
|
2025-07-07 17:08:27 +08:00
|
|
|
steps: Step[]
|
2025-03-29 16:50:39 +08:00
|
|
|
}
|
|
|
|
|
|
2025-07-07 17:08:27 +08:00
|
|
|
export function StepIndicator({ currentStep, steps }: StepIndicatorProps) {
|
|
|
|
|
const isMobile = useMobile()
|
|
|
|
|
|
2025-03-29 16:50:39 +08:00
|
|
|
return (
|
2025-07-07 17:08:27 +08:00
|
|
|
<div className="w-full mb-6">
|
2025-03-29 16:50:39 +08:00
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
{steps.map((step, index) => (
|
2025-07-07 17:08:27 +08:00
|
|
|
<div key={step.number} className="flex flex-col items-center relative w-full">
|
2025-03-29 16:50:39 +08:00
|
|
|
{/* 连接线 */}
|
|
|
|
|
{index > 0 && (
|
|
|
|
|
<div
|
|
|
|
|
className={cn(
|
|
|
|
|
"absolute h-[2px] w-full top-4 -left-1/2 z-0",
|
2025-07-07 17:08:27 +08:00
|
|
|
index < currentStep ? "bg-blue-500" : "bg-gray-200",
|
2025-03-29 16:50:39 +08:00
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* 步骤圆点 */}
|
2025-07-07 17:08:27 +08:00
|
|
|
<div
|
2025-03-29 16:50:39 +08:00
|
|
|
className={cn(
|
|
|
|
|
"w-8 h-8 rounded-full flex items-center justify-center z-10 mb-2 transition-all",
|
2025-07-07 17:08:27 +08:00
|
|
|
index + 1 < currentStep
|
|
|
|
|
? "bg-blue-500 text-white"
|
|
|
|
|
: index + 1 === currentStep
|
2025-03-29 16:50:39 +08:00
|
|
|
? "bg-blue-500 text-white"
|
2025-07-07 17:08:27 +08:00
|
|
|
: "bg-gray-200 text-gray-500",
|
2025-03-29 16:50:39 +08:00
|
|
|
)}
|
|
|
|
|
>
|
2025-07-07 17:08:27 +08:00
|
|
|
{step.number}
|
|
|
|
|
</div>
|
2025-03-29 16:50:39 +08:00
|
|
|
|
|
|
|
|
{/* 步骤标题 */}
|
2025-07-07 17:08:27 +08:00
|
|
|
<div className={cn("text-sm font-medium", index + 1 === currentStep ? "text-blue-500" : "text-gray-500")}>
|
|
|
|
|
{step.title}
|
|
|
|
|
</div>
|
|
|
|
|
{!isMobile && (
|
|
|
|
|
<div className="text-xs text-gray-500 mt-1 hidden md:block">
|
|
|
|
|
{index + 1 === 1 ? "设置群名称和微信号" : index + 1 === 2 ? "选择执行设备" : "设置流量池标签"}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2025-03-29 16:50:39 +08:00
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|