import React from "react" ; import DefaultPage from "./DefaultPage" ; const getPbNotInstalledErrorMessage = ( ) => { const isLocalhost = typeof window === "object" && window . location . hostname === "localhost" ; let adminUi = < a href = "/admin" > Admin UI < /a>; if ( isLocalhost ) { adminUi = < strong > Admin UI < /strong>; } return { title : "Installation incomplete" , message : ( < > < p > Page Builder is not installed ! < / p > < p > Before you continue , please open up the { adminUi } and complete the installation wizard . < /p> < />) } ; } ; type DefaultErrorPageProps = { error ? : any ; } ; export default function DefaultErrorPage ( props ) { let pageProps = { message : < > The link is either broken or the page has been removed . < />, title : "An error occurred" } ; if ( props ?. error ?. code === "PB_NOT_INSTALLED" ) { pageProps = getPbNotInstalledErrorMessage ( ) ; } return < DefaultPage { ... pageProps } / > ; }