Clubs page

This commit is contained in:
Timothy Armes
2023-10-09 19:06:24 +02:00
committed by Owen Rees
parent 5b2218966f
commit ed68a9280b
11 changed files with 458 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
"use client";
import { useHydrateAtoms } from "jotai/utils";
import dynamic from "next/dynamic";
import { clubsAtom } from "@/app/atoms";
import LoadingMap from "@/components/LoadingMap";
import { Club } from "@/types";
import ClubTable from "./ClubTable";
type ClubsDisplayProps = {
clubs: Club[];
};
/**
* Imports the club map component, ensuring CSR only.
* @remarks SSR is not supported by react-leaflet
*/
const ClubMap = dynamic(() => import("./ClubMap"), {
ssr: false,
loading: LoadingMap,
});
export default function ClubsDisplay({ clubs }: ClubsDisplayProps) {
useHydrateAtoms([[clubsAtom, clubs]]);
return (
<main className="relative grid h-full w-full lg:grid-cols-2">
<div>
<ClubMap />
</div>
<div className="relative bg-white dark:bg-gray-800 lg:overflow-y-auto">
<ClubTable />
</div>
</main>
);
}