diff options
Diffstat (limited to 'src/client/views/selectedDoc/SelectedDocView.tsx')
-rw-r--r-- | src/client/views/selectedDoc/SelectedDocView.tsx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/client/views/selectedDoc/SelectedDocView.tsx b/src/client/views/selectedDoc/SelectedDocView.tsx new file mode 100644 index 000000000..955a4a174 --- /dev/null +++ b/src/client/views/selectedDoc/SelectedDocView.tsx @@ -0,0 +1,47 @@ +import React = require('react'); +import { Doc } from "../../../fields/Doc"; +import { observer } from "mobx-react"; +import { computed } from "mobx"; +import { StrCast } from "../../../fields/Types"; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { Colors, ListBox } from 'browndash-components'; +import { DocumentManager } from '../../util/DocumentManager'; +import { DocFocusOptions } from '../nodes/DocumentView'; + +export interface SelectedDocViewProps { + selectedDocs: Doc[]; +} + +@observer +export class SelectedDocView extends React.Component<SelectedDocViewProps> { + + @computed get selectedDocs() { + return this.props.selectedDocs; + } + + + render() { + return <div className={`selectedDocView-container`}> + <ListBox + items={this.selectedDocs.map((doc) => { + const icon = Doc.toIcon(doc); + const iconEle = <FontAwesomeIcon size={'1x'} icon={icon} />; + const text = StrCast(doc.title) + const finished = () => { + + }; + const options: DocFocusOptions = { + playAudio: false, + }; + return { + text: text, + val: StrCast(doc._id), + icon: iconEle, + onClick: () => {DocumentManager.Instance.showDocument(doc, options, finished);} + } + })} + color={StrCast(Doc.UserDoc().userColor)} + /> + </div> + } +}
\ No newline at end of file |