diff --git a/src/frontend/next/src/components/SearchInput/SearchInput.tsx b/src/frontend/next/src/components/SearchInput/SearchInput.tsx new file mode 100644 index 0000000000..29ca701b97 --- /dev/null +++ b/src/frontend/next/src/components/SearchInput/SearchInput.tsx @@ -0,0 +1,18 @@ +import PostSearchInput from './PostSearchInput'; +import AuthorSearchInput from './AuthorSearchInput'; + +type searchInputProps = { + text: string; + onTextChange: Function; + searchFilter: string; +}; + +const SearchInput = ({ text, onTextChange, searchFilter }: searchInputProps) => { + return searchFilter === 'author' ? ( + onTextChange(event.target.value)} /> + ) : ( + onTextChange(event.target.value)} /> + ); +}; + +export default SearchInput;