import pageTemplates from "components/agility-pageTemplates" import Head from 'next/head' import { Text } from '@components/ui' const AgilityPage = ({ agilityProps, error, revalidate }: { agilityProps: any, error?: any, revalidate?: any }) => { if (!agilityProps) { console.error(`Page object or template was not found.`) return null } let pageTitle = "Commerce Storefront" if (agilityProps.globalData?.sitedata) { pageTitle = agilityProps.globalData?.sitedata.name } if (agilityProps.notFound === true) { return ( <> Page Not Found - {pageTitle}
Not Found The requested page doesn't exist or you don't have access to it.
) } if (agilityProps.pageTemplateName) { let AgilityPageTemplate = pageTemplates(agilityProps.pageTemplateName) if (!AgilityPageTemplate) { console.error(`${agilityProps.pageTemplateName} not found.`) return null } return ( <> {agilityProps.sitemapNode?.title} - {pageTitle} ) } else { return null } } export default AgilityPage