"use client"; import { Fragment } from "react"; import Image from "next/image"; import { Button } from "@plane/ui"; // helpers import { cn } from "@/helpers/common.helper"; // silo types import { TStepper, TStepperNavigation } from "@/plane-web/silo/types/ui"; export const Stepper = (props: TStepper) => { // props const { logo, steps, currentStepIndex } = props; // derived value const currentStepDetails = steps[currentStepIndex]; return (
{/* stepper header */}
{logo && (
{`Importer
)}
{steps.map((step, index) => ( {/* left bar */} {step?.prevStep && (
)} {/* content */}
{step?.icon ? step?.icon() : index + 1}
{/* right bar */} {step?.nextStep && index < steps.length - 1 && (
)} ))}
{/* title and description */}
{currentStepDetails?.title}
{currentStepDetails?.description}
{/* component */} {currentStepDetails?.component &&
{currentStepDetails.component()}
}
); }; export const StepperNavigation = (props: TStepperNavigation) => { const { currentStep, handleStep, children } = props; return (
{children ? ( children ) : ( )}
); };