summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-search/src/components/Results.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-09-29 16:03:16 +0200
committerSamy Pesse <samypesse@gmail.com>2016-09-29 16:03:16 +0200
commit7f283791544195fa70c51003db9be3f029c014ef (patch)
tree4a5ac11ed2a3f1b6e6e0a8d3e7bedd641c0f186f /packages/gitbook-plugin-search/src/components/Results.js
parent6f98ee18468e88af01a066eb6e203e4d6ef0a52c (diff)
downloadgitbook-7f283791544195fa70c51003db9be3f029c014ef.zip
gitbook-7f283791544195fa70c51003db9be3f029c014ef.tar.gz
gitbook-7f283791544195fa70c51003db9be3f029c014ef.tar.bz2
Fix dist command
Diffstat (limited to 'packages/gitbook-plugin-search/src/components/Results.js')
-rw-r--r--packages/gitbook-plugin-search/src/components/Results.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/packages/gitbook-plugin-search/src/components/Results.js b/packages/gitbook-plugin-search/src/components/Results.js
index 99bc63d..3f53741 100644
--- a/packages/gitbook-plugin-search/src/components/Results.js
+++ b/packages/gitbook-plugin-search/src/components/Results.js
@@ -1,6 +1,23 @@
const GitBook = require('gitbook-core');
const { React } = GitBook;
+const Result = React.createClass({
+ propTypes: {
+ result: React.PropTypes.object
+ },
+
+ render() {
+ const { result } = this.props;
+
+ return (
+ <div className="Search/Result">
+ <h3>{result.title}</h3>
+ <p>{result.body}</p>
+ </div>
+ );
+ }
+});
+
const SearchResults = React.createClass({
propTypes: {
results: GitBook.Shapes.list
@@ -11,8 +28,8 @@ const SearchResults = React.createClass({
return (
<div className="Search/Results">
- {results.map(result => {
-
+ {results.map((result, i) => {
+ return <Result key={i} result={result} />;
})}
</div>
);