import React, { useContext } from "react";
import { useSelector } from "react-redux";
import { WindowNameContext } from "./WindowTitleBarContext";
import { useMaximize } from "./useMaximize";
export const MaximizeButton = () => {
    var _a;
    const { toggle, isMaximized } = useMaximize();
    const state = useSelector((currentState) => currentState);
    const windowName = useContext(WindowNameContext);
    const showMaximizeButton = !!(windowName ? (_a = state.windows[windowName]) === null || _a === void 0 ? void 0 : _a.showMaximizeButton : true);
    const tooltip = isMaximized ? "Restore" : "Maximize";
    const iconClasses = isMaximized ? "ff-restore" : "ff-maximize";
    if (!showMaximizeButton)
        return React.createElement(React.Fragment, null);
    return (React.createElement("div", { className: "fsbl-icon fsbl-maximize", id: "fsbl-window-restore", title: tooltip, onClick: toggle },
        React.createElement("i", { className: iconClasses })));
};
//# sourceMappingURL=MaximizeButton.js.map