import React, { ReactNode } from 'react' import { PageMetaData } from '../patterns/PageMetaData' import { VStack, HStack, Box } from '../elements/LayoutPrimitives' import { OmnivoreNameLogo } from '../elements/images/OmnivoreNameLogo' import { StyledText } from '../elements/StyledText' import { Button } from '../elements/Button' import { useRouter } from 'next/router' import { Toaster } from 'react-hot-toast' const TOTAL_ONBOARDING_PAGES = 6 type OnboardingLayoutProps = { pageNumber: number title: string subTitle: string description?: string children: ReactNode image?: ReactNode nextPage?: string, reduceSpace?: boolean, onNext?: () => void | Promise, } export const OnboardingLayout = ({ pageNumber, title, subTitle, description, image, children, nextPage, reduceSpace, onNext, }: OnboardingLayoutProps) => { const router = useRouter() const NextButton = () => { const handleNext = async () => { onNext && await onNext() router.push(nextPage ?? `/onboarding/0${pageNumber+1}`) } return ( )} return ( <> Omnivore {title} {subTitle} {image && ( {image} )} {description && ( {description} )} {children} ) }