import React, { useContext } from "react";
import { WindowNameContext } from "./WindowTitleBarContext";
import { useSelector } from "react-redux";
import { FEAGlobals } from "../../../common/Globals";
const ShareIcon = () => (React.createElement("svg", { width: "20", height: "16", viewBox: "0 2 16 13", xmlns: "http://www.w3.org/2000/svg" },
    React.createElement("title", null, "Drag To Share"),
    React.createElement("path", { d: "M7 3H6V1H1v12h5v-3h1v3a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v2z", fill: "#8E939F" }),
    React.createElement("path", { d: "M9 11h1v2h5V1h-5v1H9V1a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1v-2z", fill: "#ECEDEF" }),
    React.createElement("rect", { fill: "#ECEDEF", x: "4", y: "6", width: "8", height: "1", rx: ".5" }),
    React.createElement("path", { stroke: "#ECEDEF", strokeLinecap: "round", strokeLinejoin: "round", d: "M9 9l2.755-2.348L9 4.128" })));
export const ShareButton = () => {
    var _a;
    const state = useSelector((currentState) => currentState);
    const windowName = useContext(WindowNameContext);
    const showShareButton = !!(windowName ? (_a = state.windows[windowName]) === null || _a === void 0 ? void 0 : _a.showShareButton : false);
    if (!showShareButton)
        return React.createElement(React.Fragment, null);
    const onDragStart = (e) => {
        FEAGlobals.FSBL.Clients.DragAndDropClient.dragStart(e.nativeEvent);
    };
    return (React.createElement("div", { className: "fsbl-icon fsbl-share", title: "Drag To Share", draggable: "true", onDragStart: onDragStart },
        React.createElement(ShareIcon, null)));
};
//# sourceMappingURL=ShareButton.js.map