/* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { action, computed, makeObservable, observable } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import { addStyleSheet } from '../../ClientUtils'; import { Doc } from '../../fields/Doc'; import { DocCast, StrCast } from '../../fields/Types'; import { MainViewModal } from '../views/MainViewModal'; import { DocumentView } from '../views/nodes/DocumentView'; import './CaptureManager.scss'; @observer export class CaptureManager extends React.Component<{}> { // eslint-disable-next-line no-use-before-define public static Instance: CaptureManager; static _settingsStyle = addStyleSheet(); @observable _document: any = undefined; @observable isOpen: boolean = false; // whether the CaptureManager is to be displayed or not. // eslint-disable-next-line react/sort-comp constructor(props: {}) { super(props); makeObservable(this); CaptureManager.Instance = this; } public close = action(() => { this.isOpen = false; }); public open = action((doc: Doc) => { this.isOpen = true; this._document = doc; }); @computed get visibilityContent() { return (
Visibility
Private
Public
); } @computed get linksContent() { const doc = this._document; const order: JSX.Element[] = []; if (doc) { Doc.Links(doc).forEach((l, i) => order.push(
{i}
{StrCast(DocCast(l.link_anchor_1)?.title)}
) ); } return (
Links
{order}
); } @computed get closeButtons() { return (
{ DocumentView.SetLightboxDoc(this._document); this.close(); }}> Save
{ const selected = DocumentView.Selected(); DocumentView.DeselectAll(); selected.map(dv => dv.props.removeDocument?.(dv.Document)); this.close(); }}> Cancel
); } private get captureInterface() { return (
Conversation Capture
{this.visibilityContent} {this.linksContent}
{this.closeButtons}
); } render() { return ( ); } }