aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/container/HelpBox.js
blob: b4556a5fb3957328a26adead07974cb1d3912087 (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
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';

const HelpBox = ({ results }) => {
  if (results.length > 0) {
    return <div />;
  }

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

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

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

export default connect(mapStateToProps)(HelpBox);