ConceptPortal-public/rsconcept/frontend/src/components/Common/ConceptSearch.tsx

31 lines
832 B
TypeScript
Raw Normal View History

2023-11-06 02:20:16 +03:00
import { MagnifyingGlassIcon } from '../Icons';
2023-12-08 19:24:08 +03:00
import Overlay from './Overlay';
2023-11-06 02:20:16 +03:00
import TextInput from './TextInput';
interface ConceptSearchProps {
value: string
onChange?: (newValue: string) => void
2023-12-08 19:24:08 +03:00
noBorder?: boolean
dimensions?: string
2023-11-06 02:20:16 +03:00
}
function ConceptSearch({ value, onChange, noBorder, dimensions }: ConceptSearchProps) {
2023-11-06 02:20:16 +03:00
return (
2023-12-08 19:24:08 +03:00
<div className={dimensions}>
<Overlay
position='top-[-0.125rem] left-3 translate-y-1/2'
className='pointer-events-none clr-text-controls'
2023-12-08 19:24:08 +03:00
>
<MagnifyingGlassIcon size={5} />
</Overlay>
<TextInput noOutline
2023-11-06 02:20:16 +03:00
placeholder='Поиск'
dimensions='w-full pl-10'
noBorder={noBorder}
2023-11-06 02:20:16 +03:00
value={value}
onChange={event => (onChange ? onChange(event.target.value) : undefined)}
2023-11-06 02:20:16 +03:00
/>
</div>);
}
export default ConceptSearch;