diff options
Diffstat (limited to 'src/Recommendations.tsx')
-rw-r--r-- | src/Recommendations.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Recommendations.tsx b/src/Recommendations.tsx new file mode 100644 index 000000000..ca1123ef9 --- /dev/null +++ b/src/Recommendations.tsx @@ -0,0 +1,28 @@ +import { observer } from "mobx-react"; +import React = require("react"); +import { Doc } from "./new_fields/Doc"; +import { NumCast } from "./new_fields/Types"; + +export interface RecProps { + documents: { preview: string, similarity: number }[], + node: Doc; +} + +@observer +export class Recommendations extends React.Component<RecProps> { + render() { + const transform = "translate(" + (NumCast(this.props.node.x) + 350) + "px, " + NumCast(this.props.node.y) + "px" + return ( + <div className="rec-scroll" style={{ transform: transform }}> + {this.props.documents.map(doc => { + return ( + <div className="recommendation-content"> + <img src={doc.preview} /> + <div>{doc.similarity}</div> + </div> + ) + })} + </div> + ) + } +}
\ No newline at end of file |