@@ -3,16 +3,24 @@ import { PageHeader, Link, AssistantLinks, DevLinkButton } from "~/components";
33import { Divider , AnchorButton , Card , Icon } from "@blueprintjs/core" ;
44import { useState } from "react" ;
55import h from "./main.module.scss" ;
6- import { onDemand } from "~/_utils" ;
76import { useData } from "vike-react/useData" ;
7+ import { ClientOnly } from "vike-react/ClientOnly" ;
88
99export function Page ( props ) {
1010 return h ( ColumnListPage , props ) ;
1111}
1212
13- const ColumnsMapContainer = onDemand ( ( ) =>
14- import ( "./map" ) . then ( ( d ) => d . ColumnsMapContainer )
15- ) ;
13+ function ColumnMapContainer ( props ) {
14+ return h (
15+ ClientOnly ,
16+ {
17+ load : ( ) => import ( "./map.client" ) . then ( ( d ) => d . ColumnsMapContainer ) ,
18+ fallback : h ( "div.loading" , "Loading map..." ) ,
19+ deps : [ props . columnIDs , props . projectID ] ,
20+ } ,
21+ ( component ) => h ( component , props )
22+ ) ;
23+ }
1624
1725function ColumnListPage ( { title = "Columns" , linkPrefix = "/" } ) {
1826 const { columnGroups, project } = useData ( ) ;
@@ -57,7 +65,7 @@ function ColumnListPage({ title = "Columns", linkPrefix = "/" }) {
5765 h ( AssistantLinks , [
5866 h ( AnchorButton , { href : "/projects" , minimal : true } , "Projects" ) ,
5967 h ( DevLinkButton , { href : "/columns/correlation" } , "Correlation chart" ) ,
60- h ( ColumnsMapContainer , { columnIDs, projectID : project . project_id } ) ,
68+ h ( ColumnMapContainer , { columnIDs, projectID : project ? .project_id } ) ,
6169 ] ) ,
6270 h ( ContentPage , [
6371 h ( PageHeader , { title } ) ,
0 commit comments