import type { GridRowId } from '../types' import type { Collection } from './types' export const getFullHeight = ( id: GridRowId, renderedRowIds: Set, meta: Collection['meta'] ) => { const rowMeta = meta.get(id) let height = 1 if (rowMeta?.children?.length) { height += rowMeta.children.reduce((m, childId) => { if (renderedRowIds.has(childId)) { return m + getFullHeight(childId, renderedRowIds, meta) } return m }, 0) } return height }