import { settingsAtom } from '@yaakapp-internal/models'; import classNames from 'classnames'; import { useAtomValue } from 'jotai'; import type { HTMLAttributes, ReactNode } from 'react'; import React from 'react'; import { useOsInfo } from '../hooks/useOsInfo'; import { useStoplightsVisible } from '../hooks/useStoplightsVisible'; import { HEADER_SIZE_LG, HEADER_SIZE_MD, WINDOW_CONTROLS_WIDTH } from '../lib/constants'; import { WindowControls } from './WindowControls'; interface HeaderSizeProps extends HTMLAttributes { children?: ReactNode; size: 'md' | 'lg'; ignoreControlsSpacing?: boolean; onlyXWindowControl?: boolean; } export function HeaderSize({ className, style, size, ignoreControlsSpacing, onlyXWindowControl, children, }: HeaderSizeProps) { const osInfo = useOsInfo(); const settings = useAtomValue(settingsAtom); const stoplightsVisible = useStoplightsVisible(); return (
{/* NOTE: This needs display:grid or else the element shrinks (even though scrollable) */}
{children}
); }