import { cn } from "cn";
import { StepNumber } from "./step-number";

type Step = { title: string; description: string };

/**
 * Mobile / tablet: numbers stacked on a vertical line, text beside them.
 * Phone & tablet (Figma 390 / 744): 40px circles joined by 30px lines with 8px around them (86px per step), text 24px away.
 */
export function ProcessTimelineVertical({ steps, className }: { steps: Step[]; className?: string }) {
  return (
    <ol className={cn("flex flex-col", className)}>
      {steps.map((step, i) => (
        <li key={step.title} className="flex gap-6">
          <div className="flex flex-col items-center">
            <StepNumber n={i + 1} />
            {i < steps.length - 1 && <span aria-hidden className="my-2 h-[30px] w-px bg-subtle/50" />}
          </div>
          <div className="flex flex-col gap-2 font-display leading-[1.66] tracking-[0.4px]">
            <h3 className="text-sm font-bold text-default">{step.title}</h3>
            <p className="text-xs text-soft">{step.description}</p>
          </div>
        </li>
      ))}
    </ol>
  );
}
