import { CheckIcon } from "@heroicons/react/16/solid"; import { cva, cx } from "@/cva.config"; import Card from "@/components/Card"; interface Props { nSteps: number; currStepIdx: number; size?: keyof typeof sizes; } const sizes = { SM: "text-xs leading-[12px]", MD: "text-sm leading-[14px]", }; const variants = cva({ variants: { size: sizes, }, }); export default function StepCounter({ nSteps, currStepIdx, size = "MD" }: Props) { const textStyle = variants({ size }); return ( {[...Array(nSteps).keys()].map(i => { if (i < currStepIdx) { return (
); } if (i === currStepIdx) { return (
Step {i + 1}
); } if (i > currStepIdx) { return ( {i + 1} ); } return null; })}
); }