import IconButton, { type IconButtonProps } from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; import { type MRT_RowData, type MRT_TableInstance } from '../../types'; export interface MRT_ToggleDensePaddingButtonProps extends IconButtonProps { table: MRT_TableInstance; } export const MRT_ToggleDensePaddingButton = ({ table, ...rest }: MRT_ToggleDensePaddingButtonProps) => { const { getState, options: { icons: { DensityLargeIcon, DensityMediumIcon, DensitySmallIcon }, localization, }, setDensity, } = table; const { density } = getState(); const handleToggleDensePadding = () => { const nextDensity = density === 'comfortable' ? 'compact' : density === 'compact' ? 'spacious' : 'comfortable'; setDensity(nextDensity); }; return ( {density === 'compact' ? ( ) : density === 'comfortable' ? ( ) : ( )} ); };