import clsx from 'clsx'; import { IconSearch } from '../Icons'; import { CProps } from '../props'; import Overlay from './Overlay'; import TextInput from './TextInput'; interface SearchBarProps extends CProps.Styling { /** Id of the search bar. */ id?: string; /** Search query. */ query: string; /** Placeholder text. */ placeholder?: string; /** Callback to be called when the search query changes. */ onChangeQuery?: (newValue: string) => void; /** Disable search icon. */ noIcon?: boolean; /** Disable border. */ noBorder?: boolean; } /** * Displays a search bar with a search icon and text input. */ function SearchBar({ id, query, noIcon, onChangeQuery, noBorder, placeholder = 'Поиск', ...restProps }: SearchBarProps) { return (