"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Widget
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDock = exports.Dock = void 0;
const React = require("react");
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
const NineZone_1 = require("../base/NineZone");
const Button_1 = require("../../preview/widget-action-dropdown/Button");
const useIsToolSettingsTab_1 = require("./useIsToolSettingsTab");
const useMaximizedWidget_1 = require("../../preview/enable-maximized-widget/useMaximizedWidget");
/** @internal */
function Dock() {
    const dispatch = React.useContext(NineZone_1.NineZoneDispatchContext);
    const label = (0, NineZone_1.useLabel)("dockToolSettingsTitle");
    return (React.createElement(Button_1.ActionButton, { icon: React.createElement(itwinui_icons_react_1.SvgDockTop, null), label: label, onClick: () => {
            dispatch({
                type: "TOOL_SETTINGS_DOCK",
            });
        } }));
}
exports.Dock = Dock;
/** @internal */
function useDock() {
    const isToolSettings = (0, useIsToolSettingsTab_1.useIsToolSettingsTab)();
    const isMaximizedWidget = (0, useMaximizedWidget_1.useIsMaximizedWidget)();
    return isToolSettings && !isMaximizedWidget;
}
exports.useDock = useDock;
//# sourceMappingURL=Dock.js.map