import React from 'react'; import Box from '@mui/material/Box'; import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; import type { MRT_Column, MRT_TableInstance } from '..'; interface Props = {}> { column: MRT_Column; table: MRT_TableInstance; } export const MRT_ColumnPinningButtons = < TData extends Record = {}, >({ column, table, }: Props) => { const { options: { icons: { PushPinIcon }, localization, }, } = table; const handlePinColumn = (pinDirection: 'left' | 'right' | false) => { column.pin(pinDirection); }; return ( {column.getIsPinned() ? ( handlePinColumn(false)} size="small"> ) : ( <> handlePinColumn('left')} size="small"> handlePinColumn('right')} size="small"> )} ); };