'use client' import { FC } from 'react' import { withController } from '@baseapp-frontend/utils' import { CircularProgress, InputAdornment } from '@mui/material' import { Box } from '@mui/system' import IconButton from '../../buttons/IconButton' import Iconify from '../../images/Iconify' import { PureTextField } from '../TextField' import { SearchbarProps } from './types' const Searchbar: FC = ({ onClear, onChange, isPending, sx, InputProps, variant = 'filled', ...props }) => ( {isPending ? ( ) : ( )} ), endAdornment: ( {onClear && props.value ? ( ) : (
)} ), sx: { '& .MuiFilledInput-input': { height: '17px', paddingTop: '14px', paddingBottom: '14px', paddingRight: '14px', maxHeight: '17px', }, '& .MuiInputAdornment-positionStart': { marginTop: '0 !important', }, }, ...InputProps, }} {...props} /> ) export default withController(Searchbar, { shouldDebounce: true })