import ClearIcon from '@mui/icons-material/Clear' import Search from '@mui/icons-material/Search' import { FormControl, IconButton, InputAdornment } from '@mui/material' import type { ChangeEventHandler, FocusEventHandler, RefObject } from 'react' import { InputCard } from '../../components/Card/InputCard.js' import { useHeaderHeight } from '../../stores/header/useHeaderStore.js' import { Input, StickySearchInputContainer } from './SearchInput.style.js' interface SearchInputProps { inputRef?: RefObject name?: string value?: string placeholder?: string onChange?: ChangeEventHandler onBlur?: FocusEventHandler onClear?: () => void autoFocus?: boolean size?: 'small' | 'medium' } export const SearchInput = ({ inputRef, name, placeholder, onChange, onBlur, onClear, value, autoFocus, size = 'medium', }: SearchInputProps) => { return ( } endAdornment={ (value || inputRef?.current?.value) && onClear && ( ) } inputProps={{ inputMode: 'search', onChange, onBlur, name, value, maxLength: 128, }} autoComplete="off" autoFocus={autoFocus} /> ) } export const StickySearchInput = (props: SearchInputProps) => { const { headerHeight } = useHeaderHeight() return ( ) }