import './ButtonMenu.scss';
import * as React from 'react';
import { IButtonMenu } from "./utils";
import { NewLightboxView } from '../NewLightboxView';
import { SelectionManager } from '../../../util/SelectionManager';
import { CollectionDockingView } from '../../collections/CollectionDockingView';
import { OpenWhereMod } from '../../nodes/DocumentView';
import { Doc } from '../../../../fields/Doc';
import { InkTool } from '../../../../fields/InkField';
import { MainView } from '../../MainView';
import { action } from 'mobx';

export const ButtonMenu = (props: IButtonMenu) => {
    
    return <div className={`newLightboxButtonMenu-container`}>
        <div
                    className="newLightboxView-navBtn"
                    title="toggle fit width"
                    onClick={e => {
                        e.stopPropagation();
                        NewLightboxView.NewLightboxDoc!._fitWidth = !NewLightboxView.NewLightboxDoc!._fitWidth;
                    }}>
                </div>
                <div
                    className="newLightboxView-tabBtn"
                    title="open in tab"
                    onClick={e => {
                        e.stopPropagation();
                        CollectionDockingView.AddSplit(NewLightboxView.NewLightboxDoc || NewLightboxView.NewLightboxDoc!, OpenWhereMod.none);
                        SelectionManager.DeselectAll();
                        NewLightboxView.SetNewLightboxDoc(undefined);
                    }}>
                </div>
                <div
                    className="newLightboxView-penBtn"
                    title="toggle pen annotation"
                    style={{ background: Doc.ActiveTool === InkTool.Pen ? 'white' : undefined }}
                    onClick={e => {
                        e.stopPropagation();
                        Doc.ActiveTool = Doc.ActiveTool === InkTool.Pen ? InkTool.None : InkTool.Pen;
                    }}>
                </div>
                <div
                    className="newLightboxView-exploreBtn"
                    title="toggle explore mode to navigate among documents only"
                    style={{ background: MainView.Instance._exploreMode ? 'white' : undefined }}
                    onClick={action(e => {
                        e.stopPropagation();
                        MainView.Instance._exploreMode = !MainView.Instance._exploreMode;
                    })}>
                </div>
    </div>
}