import React, { useContext } from "react";
import { actions } from "../../../platform/services/window/modules/actions";
import { WindowNameContext } from "./WindowTitleBarContext";
import { useDispatch, useSelector } from "react-redux";
export const MinimizeButton = () => {
    var _a;
    const dispatch = useDispatch();
    const state = useSelector((currentState) => currentState);
    const windowName = useContext(WindowNameContext);
    const showMinimizeButton = !!(windowName ? (_a = state.windows[windowName]) === null || _a === void 0 ? void 0 : _a.showMinimizeButton : true);
    if (!showMinimizeButton)
        return React.createElement(React.Fragment, null);
    const minimizeThisWindow = () => {
        dispatch(actions.minimize({
            windowName: window.name,
        }));
    };
    return (React.createElement("div", { className: "fsbl-icon fsbl-minimize", id: "fsbl-window-minimize", title: "Minimize", onClick: minimizeThisWindow },
        React.createElement("i", { className: "ff-minimize" })));
};
//# sourceMappingURL=MinimizeButton.js.map