aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-12-10 00:41:32 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-12-10 00:41:32 +0100
commit0141d1f9f4c7ca1755e0a5da908e9d27cf7aa0e1 (patch)
tree8d632c5c849e71e4905a67d681bea395c23cb0d1 /src/client/react/components
parent503f94199f7fc730da4a1a1165c2863956d10000 (diff)
Add presentation search component
Diffstat (limited to 'src/client/react/components')
-rw-r--r--src/client/react/components/presentational/Search.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/react/components/presentational/Search.js b/src/client/react/components/presentational/Search.js
new file mode 100644
index 0000000..0dde8a6
--- /dev/null
+++ b/src/client/react/components/presentational/Search.js
@@ -0,0 +1,24 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+
+const Search = ({ onInput, results }) => (
+ <div>
+ <input
+ onInput={onInput}
+ placeholder="Zoeken"
+ />
+ <ul>
+ {results.map(result => <li key={result.name}>{result.name}</li>)}
+ </ul>
+ </div>
+);
+
+Search.propTypes = {
+ onInput: PropTypes.func.isRequired,
+ results: PropTypes.arrayOf(PropTypes.shape({
+ name: PropTypes.string.require,
+ type: PropTypes.string.require,
+ })).isRequired,
+};
+
+export default Search;