import { useRouter } from "next/router"; import { ComponentProps } from "react"; import classNames from "@calcom/lib/classNames"; import { Button, Stepper } from "../../.."; type DefaultStep = { title: string; description: string; content: JSX.Element; enabled?: boolean; isLoading: boolean; }; function WizardForm(props: { href: string; steps: T[]; disableNavigation?: boolean; containerClassname?: string; prevLabel?: string; nextLabel?: string; finishLabel?: string; stepLabel?: ComponentProps["stepLabel"]; }) { const { href, steps, nextLabel = "Next", finishLabel = "Finish", prevLabel = "Back", stepLabel } = props; const router = useRouter(); const step = parseInt((router.query.step as string) || "1"); const currentStep = steps[step - 1]; const setStep = (newStep: number) => { router.replace(`${href}?step=${newStep || 1}`, undefined, { shallow: true }); }; return (
{/* eslint-disable-next-line @next/next/no-img-element */} Cal.com Logo

{currentStep.title}

{currentStep.description}

{currentStep.content}
{!props.disableNavigation && ( <> {currentStep.enabled !== false && (
{step > 1 && ( )}
)} )}
{!props.disableNavigation && (
)}
); } export default WizardForm;