import { useLearningPath } from "@site/src/providers/LearningPath" import React from "react" import LearningPathStepActions from "./Actions" import clsx from "clsx" import IconCircleDottedLine from "@site/src/theme/Icon/CircleDottedLine" import Link from "@docusaurus/Link" import { CheckCircleSolid, CircleMiniSolid } from "@medusajs/icons" type LearningPathStepsProps = { onFinish?: () => void onClose?: () => void } const LearningPathSteps: React.FC = ({ ...rest }) => { const { path, currentStep, goToStep } = useLearningPath() if (!path) { return <> } return ( <>
{path.steps.map((step, index) => (
{index === currentStep && ( )} {index < currentStep && ( )} {index > currentStep && ( )}
{step.title}
{index === currentStep && (
{step.descriptionJSX ?? step.description}
)} { e.preventDefault() goToStep(index) }} />
))}
) } export default LearningPathSteps