aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/container/HelpBox.js
blob: a74b43c0667e6915e62823e4793b779ccdb793cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';

const HelpBox = ({ results, searchText }) => {
  if (results.length > 0 || searchText !== '') {
    return <div />;
  }

  return (
    <div className="help-box">
      <div className="arrow" />
      <div className="bubble">
        Voer hier een docentafkorting, klas, leerlingnummer of lokaalnummer in.
      </div>
    </div>
  );
};

HelpBox.propTypes = {
  results: PropTypes.arrayOf(PropTypes.string).isRequired,
  searchText: PropTypes.string.isRequired,
};

const mapStateToProps = state => ({
  results: state.search.results,
  searchText: state.search.searchText,
});

export default connect(mapStateToProps)(HelpBox);