import Box from '@mui/material/Box'; import { type IconButtonProps } from '@mui/material/IconButton'; import { type MRT_Row, type MRT_RowData, type MRT_TableInstance, } from '../../types'; import { parseFromValuesOrFunc } from '../../utils/utils'; import { MRT_RowPinButton } from '../buttons/MRT_RowPinButton'; export interface MRT_TableBodyRowPinButtonProps extends IconButtonProps { row: MRT_Row; table: MRT_TableInstance; } export const MRT_TableBodyRowPinButton = ({ row, table, ...rest }: MRT_TableBodyRowPinButtonProps) => { const { getState, options: { enableRowPinning, rowPinningDisplayMode }, } = table; const { density } = getState(); const canPin = parseFromValuesOrFunc(enableRowPinning, row as any); if (!canPin) return null; const rowPinButtonProps = { row, table, ...rest, }; if (rowPinningDisplayMode === 'top-and-bottom' && !row.getIsPinned()) { return ( ); } return ( ); };