import { type ActionIconProps, Box } from '@mantine/core'; import { type MRT_Row, type MRT_RowData, type MRT_TableInstance, } from '../../types'; import { parseFromValuesOrFunc } from '../../utils/utils'; import { MRT_RowPinButton } from '../buttons/MRT_RowPinButton'; interface Props extends ActionIconProps { row: MRT_Row; table: MRT_TableInstance; } export const MRT_TableBodyRowPinButton = ({ row, table, ...rest }: Props) => { 'use no memo'; 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 ( ); };