"use client"; // eslint-disable-next-line no-restricted-imports import { noop } from "lodash"; import { usePathname } from "next/navigation"; import React, { useEffect, useState } from "react"; import { Toaster } from "sonner"; import { APP_NAME } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "../../components/button/Button"; import { StepCard } from "../../components/card/StepCard"; import { Steps } from "../../components/form/step/Steps"; import { SkeletonText } from "../../components/skeleton/Skeleton"; export function WizardLayout({ children, maxSteps = 2, currentStep = 0, isOptionalCallback, }: { children: React.ReactNode; } & { maxSteps?: number; currentStep?: number; isOptionalCallback?: () => void }) { const { t, isLocaleReady } = useLocale(); const [meta, setMeta] = useState({ title: "", subtitle: " " }); const pathname = usePathname(); const { title, subtitle } = meta; useEffect(() => { setMeta({ title: window.document.title, subtitle: window.document.querySelector('meta[name="description"]')?.getAttribute("content") || "", }); }, [pathname]); return (
{isLocaleReady ? ( <>

{title.replace(` | ${APP_NAME}`, "")} 

{subtitle} 

) : ( <> )}
{children}
{isOptionalCallback && (
)}
); } export const getLayout = (page: React.ReactElement) => {page};