import type { JSX, ReactNode } from 'react'; // biome-ignore lint/style/noRestrictedImports: ignore import { usePrintMode } from '~/client/services/use-print-mode'; import styles from './PageViewLayout.module.scss'; const pageViewLayoutClass = styles['page-view-layout'] ?? ''; const _fluidLayoutClass = styles['fluid-layout'] ?? ''; type Props = { className?: string; children?: ReactNode; headerContents?: ReactNode; sideContents?: ReactNode; footerContents?: ReactNode; expandContentWidth?: boolean; }; export const PageViewLayout = (props: Props): JSX.Element => { const { className, children, headerContents, sideContents, footerContents, expandContentWidth, } = props; const isPrinting = usePrintMode(); const fluidLayoutClass = expandContentWidth ? _fluidLayoutClass : ''; return ( <>
{headerContents != null && headerContents} {!isPrinting && sideContents != null ? (
{children}
{sideContents}
) : (
{children}
)}
{footerContents != null && ( )} ); };