2023-11-06 02:20:16 +03:00
|
|
|
import { MagnifyingGlassIcon } from '../Icons';
|
|
|
|
import TextInput from './TextInput';
|
|
|
|
|
|
|
|
interface ConceptSearchProps {
|
|
|
|
value: string
|
|
|
|
onChange?: (newValue: string) => void
|
|
|
|
dense?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
function ConceptSearch({ value, onChange, dense }: ConceptSearchProps) {
|
|
|
|
const borderClass = dense ? 'border-t border-x': '';
|
|
|
|
return (
|
|
|
|
<div className='relative'>
|
|
|
|
<div className='absolute inset-y-0 flex items-center pl-3 pointer-events-none text-controls'>
|
|
|
|
<MagnifyingGlassIcon />
|
|
|
|
</div>
|
2023-12-05 01:22:44 +03:00
|
|
|
<TextInput noOutline
|
2023-11-06 02:20:16 +03:00
|
|
|
placeholder='Поиск'
|
2023-12-05 01:22:44 +03:00
|
|
|
dimensions={`w-full pl-10 ${borderClass}`}
|
2023-11-06 02:20:16 +03:00
|
|
|
noBorder={dense}
|
|
|
|
value={value}
|
2023-11-27 11:33:34 +03:00
|
|
|
onChange={event => (onChange ? onChange(event.target.value) : undefined)}
|
2023-11-06 02:20:16 +03:00
|
|
|
/>
|
|
|
|
</div>);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ConceptSearch;
|
|
|
|
|
|
|
|
|