+ {
+ data.sections.map(
+ (s) =>
+
+
+ )
+ }
+
+};
+
+const AsyncDynamicRoutePage: React.FC = () => {
+ const location = useLocation();
+ const { data } = Hooks.BackendAPI.useFlattenSiteMapQuery();
+ const nestedSiteMap = Utils.buildNestedSiteMap(data);
+
+ const currentRouteCodes = ['', ...location.pathname.split('/').filter((code) => !R.isEmpty(code))];
+
+ let currentSitemap: Schemas.NestedSiteMapSchema | null | undefined = nestedSiteMap[currentRouteCodes[0]];
+ if (currentSitemap === undefined) {
+ return <>404 Not Found>;
+ }
+
+ for (const routeCode of currentRouteCodes.slice(1)) {
+ if ((currentSitemap = currentSitemap.children[routeCode]) === undefined) {
+ break;
+ }
+ }
+
+ return R.isNullish(currentSitemap)
+ ? <>404 Not Found>
+ :