Add leaflet-powered brewery map

This commit is contained in:
Aaron Po
2026-08-26 03:40:11 -04:00
parent 4ca35de7ef
commit d6306cbcba
11 changed files with 306 additions and 20 deletions

View File

@@ -0,0 +1,21 @@
import { useSyncExternalStore, type ReactNode } from 'react';
interface ClientOnlyProps {
children: () => ReactNode;
fallback?: ReactNode;
}
const noop = () => undefined;
const emptySubscribe = () => noop;
const ClientOnly = ({ children, fallback = null }: ClientOnlyProps) => {
const mounted = useSyncExternalStore(
emptySubscribe,
() => true,
() => false,
);
return mounted ? children() : fallback;
};
export default ClientOnly;