
* disable filter options when live tailing mode is enabled * prevent seek direction change when stop loading is pressed on live mode * disable submit button while tailing * write tests for MultiSelect.styled component to achieve 100% coverage
36 lines
720 B
TypeScript
36 lines
720 B
TypeScript
import React from 'react';
|
|
import { useDebouncedCallback } from 'use-debounce';
|
|
import Input from 'components/common/Input/Input';
|
|
|
|
interface SearchProps {
|
|
handleSearch: (value: string) => void;
|
|
placeholder?: string;
|
|
value: string;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
const Search: React.FC<SearchProps> = ({
|
|
handleSearch,
|
|
placeholder = 'Search',
|
|
value,
|
|
disabled = false,
|
|
}) => {
|
|
const onChange = useDebouncedCallback(
|
|
(e) => handleSearch(e.target.value),
|
|
300
|
|
);
|
|
|
|
return (
|
|
<Input
|
|
type="text"
|
|
placeholder={placeholder}
|
|
onChange={onChange}
|
|
defaultValue={value}
|
|
leftIcon="fas fa-search"
|
|
inputSize="M"
|
|
disabled={disabled}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Search;
|