import clsx from 'clsx' import { useEffect } from 'react' import { BottomNavBar } from './nav/nav-bar' import Sidebar from './nav/sidebar' import { initPreviews } from 'link-summoner' import { ReactNode } from 'react' import { Toaster } from 'react-hot-toast' export function Page(props: { margin?: boolean assertUser?: 'signed-in' | 'signed-out' rightSidebar?: ReactNode suspend?: boolean children?: ReactNode }) { const { margin, assertUser, children, rightSidebar, suspend } = props if (typeof document !== 'undefined') { // Seems to be undefined; because of https://i.imgur.com/4bMQ8rA.png ? console.log(initPreviews) } return ( <>
{children} {/* If right sidebar is hidden, place its content at the bottom of the page. */}
{rightSidebar}
) } const visuallyHiddenStyle = { clip: 'rect(0 0 0 0)', clipPath: 'inset(50%)', height: 1, margin: -1, overflow: 'hidden', padding: 0, position: 'absolute', width: 1, whiteSpace: 'nowrap', } as const