import clsx from 'clsx'; import classes from './MRT_TableFooter.module.css'; import { TableTfoot, type TableTfootProps } from '@mantine/core'; import { MRT_TableFooterRow } from './MRT_TableFooterRow'; import { type MRT_ColumnVirtualizer, type MRT_RowData, type MRT_TableInstance, } from '../../types'; import { parseFromValuesOrFunc } from '../../utils/utils'; interface Props extends TableTfootProps { columnVirtualizer?: MRT_ColumnVirtualizer; table: MRT_TableInstance; } export const MRT_TableFooter = ({ columnVirtualizer, table, ...rest }: Props) => { 'use no memo'; const { getFooterGroups, getState, options: { enableStickyFooter, layoutMode, mantineTableFooterProps }, refs: { tableFooterRef }, } = table; const { isFullScreen } = getState(); const tableFooterProps = { ...parseFromValuesOrFunc(mantineTableFooterProps, { table, }), ...rest, }; const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false; return ( { tableFooterRef.current = ref; if (tableFooterProps?.ref) { // @ts-ignore tableFooterProps.ref.current = ref; } }} > {getFooterGroups().map((footerGroup) => ( ))} ); };