feat: establish reservation portal foundation

This commit is contained in:
2026-08-04 15:24:08 +01:00
commit c96264ae96
226 changed files with 32232 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { useSyncExternalStore } from 'react';
const MOBILE_BREAKPOINT = 768;
const mql =
typeof window === 'undefined'
? undefined
: window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
function mediaQueryListener(callback: (event: MediaQueryListEvent) => void) {
if (!mql) {
return () => {};
}
mql.addEventListener('change', callback);
return () => {
mql.removeEventListener('change', callback);
};
}
function isSmallerThanBreakpoint(): boolean {
return mql?.matches ?? false;
}
function getServerSnapshot(): boolean {
return false;
}
export function useIsMobile(): boolean {
return useSyncExternalStore(
mediaQueryListener,
isSmallerThanBreakpoint,
getServerSnapshot,
);
}