"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 Frontstage
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModalFrontstage = void 0;
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
const itwinui_react_1 = require("@itwin/itwinui-react");
const classnames_1 = require("classnames");
const React = require("react");
const UiFramework_1 = require("../UiFramework");
const Back_1 = require("../layout/widget/tools/button/Back");
require("./ModalFrontstage.scss");
/** ModalFrontstage React component
 * @public
 */
class ModalFrontstage extends React.Component {
    constructor(props) {
        super(props);
        this._onGoBack = () => {
            if (this.props.navigateBack)
                this.props.navigateBack();
            this.props.closeModal();
        };
    }
    render() {
        const classNames = (0, classnames_1.default)("uifw-modal-frontstage", this.props.isOpen && "uifw-modal-open", this.props.className);
        return (React.createElement(React.Fragment, null,
            React.createElement("div", { className: classNames, style: this.props.style },
                React.createElement("div", { className: "uifw-modal-app-bar" },
                    React.createElement(Back_1.BackButton, { className: "nz-toolbar-button-app", onClick: this._onGoBack, icon: React.createElement(itwinui_icons_react_1.SvgProgressBackwardCircular, null), title: UiFramework_1.UiFramework.translate("modalFrontstage.backButtonTitle") }),
                    React.createElement(itwinui_react_1.Text, { variant: "headline", className: "uifw-headline" }, this.props.title),
                    this.props.appBarRight && (React.createElement("span", { className: "uifw-modal-app-bar-right" }, this.props.appBarRight))),
                React.createElement("div", { className: "uifw-modal-stage-content" }, this.props.children)),
            React.createElement("div", { className: "uifw-modal-frontstage-overlay" })));
    }
}
exports.ModalFrontstage = ModalFrontstage;
//# sourceMappingURL=ModalFrontstage.js.map