import { CheckIcon } from "@heroicons/react/16/solid"; import Card from "@components/Card"; import { m } from "@localizations/messages.js"; import { cva, cx } from "@/cva.config"; 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 (
{m.step_counter_step({ step: i + 1 })}
); } if (i > currStepIdx) { return ( {i + 1} ); } return null; })}
); }