('rd')
+
+ useEffect(() => {
+ if (env?.customization?.product_name) {
+ document.title = `${env?.customization?.product_name}: Unauthorized`;
+ }
+ }, [env]);
+
+ useEffect(() => {
+ if (env?.analytics_tracking_id && props.code) {
+ ReactGA.pageview(`/${props.code}.html`);
+ } else if (env?.analytics_tracking_id) {
+ ReactGA.pageview(`/error.html`);
+ }
+ }, [env?.analytics_tracking_id, props.code]);
+
+ const renderErrorMessage = (code: string) => {
+ switch(code) {
+ case '401': {
+ return (
+ <>
+ You must Sign In to view this page.
+
+ >
+ );
+ }
+ case '503': {
+ return(
+ rd ?
+ <>
+ App is still launching.. Please wait and you will be redirected when it is online.
+
+ >
+ :
+ <>
+ An unknown error has occurred
+ {
+ props?.code && Code: {props.code}
+ }
+ >
+ );
+ }
+ case '404': {
+ return(
+ <>
+ Page not found, please try again :(
+ If you think you have reached this page in error, contact your administrator.
+ >
+ );
+ }
+ default: {
+ return(
+ <>
+ An unknown error has occurred
+ {
+ props?.code && Code: {props.code}
+ }
+ >
+ );
+ }
+ }
+ }
+
+ return (
+ redirect ?
+
+ :
+
+ {renderErrorMessage(props?.code)}
+
+
+ );
+}
+
+export default ErrorPage;