import type { ReactNode } from "react"; import type { WizardStep } from "../types"; import Dialog, { type DialogProps } from "./Dialog"; import Stepper from "./Stepper"; export type GuidedConfigDialogProps = Omit & { steps: WizardStep[]; activeStep: string; onStepChange: (stepId: string) => void; intro?: ReactNode; children: ReactNode; }; function joinClasses(...classes: Array) { return classes.filter(Boolean).join(" "); } export default function GuidedConfigDialog({ steps, activeStep, onStepChange, intro, children, className = "", bodyClassName = "", ...dialogProps }: GuidedConfigDialogProps) { const active = steps.find((step) => step.id === activeStep) ?? steps[0]; return (
{intro &&
{intro}
} {active && (

{active.label}

{active.description &&

{active.description}

}
)}
{children}
); }