import type { FunctionComponent } from "react" import { CheckIcon } from "@heroicons/react/solid" import clsx from "clsx" import { Link, Routes, useRouter } from "blitz" import useCustomerPhoneNumber from "../../core/hooks/use-customer-phone-number" type StepLink = { href: string label: string } type Props = { currentStep: 1 | 2 | 3 previous?: StepLink next?: StepLink } const steps = ["Welcome", "Twilio Credentials", "Pick a plan"] as const const OnboardingLayout: FunctionComponent = ({ children, currentStep, previous, next }) => { const router = useRouter() const customerPhoneNumber = useCustomerPhoneNumber() if (customerPhoneNumber) { throw router.push(Routes.Messages()) } return (
{/* This element is to trick the browser into centering the modal contents. */}

{steps[currentStep - 1]}

{children}
) } export default OnboardingLayout