import { ActionIcon, type ActionIconProps, Tooltip } from '@mantine/core'; import { type HTMLPropsRef, type MRT_RowData, type MRT_TableInstance, } from '../../types'; interface Props extends ActionIconProps, HTMLPropsRef { table: MRT_TableInstance; } export const MRT_ToggleGlobalFilterButton = ({ table: { getState, options: { icons: { IconSearch, IconSearchOff }, localization: { showHideSearch }, }, refs: { searchInputRef }, setShowGlobalFilter, }, title, ...rest }: Props) => { 'use no memo'; const { globalFilter, showGlobalFilter } = getState(); const handleToggleSearch = () => { setShowGlobalFilter(!showGlobalFilter); setTimeout(() => searchInputRef.current?.focus(), 100); }; return ( {showGlobalFilter ? : } ); };