| 1 | "use client"; |
| 2 | |
| 3 | import { Check, Palette, Shapes, Type } from "lucide-react"; |
| 4 | |
| 5 | import { cn } from "@/lib/utils"; |
| 6 | import { type CreateThemeStep } from "./create-theme-types"; |
| 7 | |
| 8 | interface CreateThemeStepperProps { |
| 9 | currentStep: CreateThemeStep; |
| 10 | onStepClick: (step: CreateThemeStep) => void; |
| 11 | } |
| 12 | |
| 13 | const steps: Array<{ |
| 14 | id: CreateThemeStep; |
| 15 | label: string; |
| 16 | icon: typeof Palette; |
| 17 | }> = [ |
| 18 | { id: "colors", label: "Colors", icon: Palette }, |
| 19 | { id: "fonts", label: "Fonts", icon: Type }, |
| 20 | { id: "design", label: "Design", icon: Shapes }, |
| 21 | { id: "save", label: "Save", icon: Check }, |
| 22 | ]; |
| 23 | |
| 24 | export function CreateThemeStepper({ |
| 25 | currentStep, |
| 26 | onStepClick, |
| 27 | }: CreateThemeStepperProps) { |
| 28 | return ( |
| 29 | <div className="flex items-center gap-4"> |
| 30 | {steps.map((item, index) => { |
| 31 | const IconComponent = item.icon; |
| 32 | const isActive = currentStep === item.id; |
| 33 | |
| 34 | return ( |
| 35 | <div key={item.id} className="flex items-center gap-4"> |
| 36 | <button |
| 37 | onClick={() => onStepClick(item.id)} |
| 38 | className={cn( |
| 39 | "flex size-10 items-center justify-center rounded-full transition-all duration-200", |
| 40 | isActive |
| 41 | ? "scale-110 bg-blue-600 text-white shadow-lg" |
| 42 | : "bg-muted text-muted-foreground hover:bg-muted/70", |
| 43 | )} |
| 44 | title={item.label} |
| 45 | type="button" |
| 46 | > |
| 47 | <IconComponent className="size-5" /> |
| 48 | </button> |
| 49 | {index < steps.length - 1 && ( |
| 50 | <div className="h-0.5 w-12 bg-muted" /> |
| 51 | )} |
| 52 | </div> |
| 53 | ); |
| 54 | })} |
| 55 | </div> |
| 56 | ); |
| 57 | } |
| 58 |