import clsx from 'clsx'; import { Overlay } from '@/components/Container'; import { IconSearch } from '@/components/Icons'; import { CProps } from '@/components/props'; 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. */ export function SearchBar({ id, query, noIcon, onChangeQuery, noBorder, placeholder = 'Поиск', ...restProps }: SearchBarProps) { return (
{!noIcon ? ( ) : null} onChangeQuery?.(event.target.value)} />
); }