import React, { ReactNode, useMemo } from 'react'; import { Box, Text } from '@wix/design-system'; import { ToolbarCollectionState } from '../../state'; import { FiltersMap } from '@wix/bex-core'; import { observer } from 'mobx-react-lite'; interface GridSectionHeaderProps { sectionTitle: ReactNode; suffix?: ReactNode; state: ToolbarCollectionState; } function _GridSectionHeader({ sectionTitle, suffix, state, }: GridSectionHeaderProps) { const { minimizedHeaderHeight, toolbarRect: { rect: { height: toolbarHeight }, }, internalScroll, } = state; const top = useMemo(() => { if (toolbarHeight == null || internalScroll) { return 0; } return toolbarHeight + minimizedHeaderHeight; }, [minimizedHeaderHeight, toolbarHeight, internalScroll]); return ( {sectionTitle} {suffix} ); } export const GridSectionHeader = observer(_GridSectionHeader);