import { DefaultTooltip, KeenIcon, useDataGrid } from '@/components'; import { useManageNotificationContext } from '../hooks/useManageNotificationContext'; import { Button } from '@/components/ui/button'; import { useEffect, useState } from 'react'; const ListToolBar = () => { const { table, reload } = useDataGrid(); const { handleAddDialog } = useManageNotificationContext(); const [searchValue, setSearchValue] = useState( (table.getColumn('content')?.getFilterValue() as string) ?? '' ); const handleKeyDown = (event: React.KeyboardEvent) => { if (event.key === 'Enter') { handleSearch(); } }; const handleSearch = () => { table.getColumn('content')?.setFilterValue(searchValue); table.setPageIndex(0); }; useEffect(() => { const timer = setTimeout(() => { table.getColumn('content')?.setFilterValue(searchValue); table.setPageIndex(0); }, 200); return () => clearTimeout(timer); }, [searchValue, table]); return (
{/* */}
); }; export { ListToolBar };