import { type DragEventHandler } from 'react'; import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core'; import { type HTMLPropsRef, type MRT_TableInstance } from '../types'; import {Icon} from "@iconify/react"; interface Props = {}> { actionIconProps?: ActionIconProps & HTMLPropsRef; onDragStart: DragEventHandler; onDragEnd: DragEventHandler; table: MRT_TableInstance; } export const MRT_GrabHandleButton = = {}>({ actionIconProps, onDragEnd, onDragStart, table, }: Props) => { const { options: { localization, }, } = table; return ( { e.stopPropagation(); actionIconProps?.onClick?.(e); }} onDragStart={onDragStart} onDragEnd={onDragEnd} sx={(theme) => ({ cursor: 'grab', opacity: 0.75, padding: '1px', transition: 'opacity 100ms ease-in-out', '&:hover': { backgroundColor: 'transparent', opacity: 1, }, '&:active': { cursor: 'grabbing', }, ...(actionIconProps?.sx instanceof Function ? actionIconProps?.sx(theme) : (actionIconProps?.sx as any)), })} title={undefined} > ); };