Files
calendar/apps/web/components/getting-started/components/Steps.tsx
T
alannncGitHubkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>zomars
f3bedabf92 Fix/styles getting started v2 (#4224)
* Fixes spacings style

* Fix spacings

* Update test

* Fix router push when image upload is success, also typo

* Fix styles for mobile

* Sumodule sync

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
2022-09-06 19:34:33 -06:00

38 lines
1.2 KiB
TypeScript

import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
interface ISteps {
maxSteps: number;
currentStep: number;
navigateToStep: (step: number) => void;
}
const Steps = (props: ISteps) => {
const { maxSteps, currentStep, navigateToStep } = props;
const { t } = useLocale();
return (
<div className="mt-6 space-y-2">
<p className="text-xs font-medium text-gray-500 dark:text-white">
{t("current_step_of_total", { currentStep: currentStep + 1, maxSteps })}
</p>
<div className="flex w-full space-x-2 rtl:space-x-reverse">
{new Array(maxSteps).fill(0).map((_s, index) => {
return index <= currentStep ? (
<div
key={`step-${index}`}
onClick={() => navigateToStep(index)}
className={classNames(
"h-1 w-1/4 rounded-[1px] bg-black dark:bg-white",
index < currentStep ? "cursor-pointer" : ""
)}
/>
) : (
<div key={`step-${index}`} className="h-1 w-1/4 rounded-[1px] bg-black bg-opacity-25" />
);
})}
</div>
</div>
);
};
export { Steps };