import { Paper } from '@mantine/core'; import { MRT_TopToolbar } from '../toolbar/MRT_TopToolbar'; import { MRT_BottomToolbar } from '../toolbar/MRT_BottomToolbar'; import { MRT_TableContainer } from './MRT_TableContainer'; import { type MRT_TableInstance } from '../types'; interface Props = {}> { table: MRT_TableInstance; } export const MRT_TablePaper = = {}>({ table, }: Props) => { const { getState, options: { enableBottomToolbar, enableTopToolbar, mantinePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table; const { isFullScreen } = getState(); const tablePaperProps = mantinePaperProps instanceof Function ? mantinePaperProps({ table }) : mantinePaperProps; return ( { tablePaperRef.current = ref; if (tablePaperProps?.ref) { tablePaperProps.ref.current = ref; } }} sx={(theme) => ({ overflow: 'hidden', transition: 'all 100ms ease-in-out', ...(tablePaperProps?.sx instanceof Function ? tablePaperProps?.sx(theme) : (tablePaperProps?.sx as any)), })} style={{ ...(isFullScreen ? { bottom: 0, height: '100vh', left: 0, margin: 0, maxHeight: '100vh', maxWidth: '100vw', padding: 0, position: 'fixed', right: 0, top: 0, width: '100vw', zIndex: 100, } : {}), ...tablePaperProps?.style, }} > {enableTopToolbar && (renderTopToolbar instanceof Function ? renderTopToolbar({ table }) : renderTopToolbar ?? )} {enableBottomToolbar && (renderBottomToolbar instanceof Function ? renderBottomToolbar({ table }) : renderBottomToolbar ?? )} ); };