import React from 'react'; import { Box, TextField, MenuItem, FormControl, IconButton, Select, SelectChangeEvent } from '@mui/material'; import { Close } from '@mui/icons-material'; import { Filters } from './Filters/Filters'; import { useIsMobile } from '../hooks/useIsMobile'; const fieldsHeight = '42.25px'; type TableToolBarProps = { onChangeSearch?: (arg: string) => void; onChangePageSize: (event: SelectChangeEvent) => void; pageSize: string; searchTerm?: string; withFilters?: boolean; childrenBefore?: React.ReactNode; childrenAfter?: React.ReactNode; }; export const TableToolbar: FCWithChildren = ({ searchTerm, onChangeSearch, onChangePageSize, pageSize, childrenBefore, childrenAfter, withFilters, }) => { const isMobile = useIsMobile(); return ( {childrenBefore} {!!onChangeSearch && ( onChangeSearch('')}> ) : undefined, }} onChange={(event) => onChangeSearch(event.target.value)} /> )} {withFilters && } {childrenAfter} ); };