1
0
Fork 0
blog/src/components/Search/SearchResultsEmpty.jsx

25 lines
685 B
React
Raw Normal View History

2018-11-18 19:54:25 +01:00
import React from 'react'
import PropTypes from 'prop-types'
import styles from './SearchResultsEmpty.module.scss'
const SearchResultsEmpty = ({ searchQuery, results }) => (
<div className={styles.empty}>
<header className={styles.emptyMessage}>
<p className={styles.emptyMessageText}>
{searchQuery.length > 1 && results.length === 0
? 'No results found'
: searchQuery.length === 1
? 'Just one more character'
: 'Awaiting your input'}
</p>
</header>
</div>
)
SearchResultsEmpty.propTypes = {
results: PropTypes.array.isRequired,
searchQuery: PropTypes.string.isRequired
}
export default SearchResultsEmpty