"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;
require("./ModalFrontstage.scss");
const classnames_1 = require("classnames");
const React = require("react");
const core_react_1 = require("@itwin/core-react");
const appui_layout_react_1 = require("@itwin/appui-layout-react");
const UiFramework_1 = require("../UiFramework");
const itwinui_react_1 = require("@itwin/itwinui-react");
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
/**
 * ModalFrontstage React component
 * @public
 */
class ModalFrontstage extends React.Component {
    constructor(props) {
        super(props);
        this._backButtonTitle = UiFramework_1.UiFramework.translate("modalFrontstage.backButtonTitle");
        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(appui_layout_react_1.BackButton, { className: "nz-toolbar-button-app", onClick: this._onGoBack, icon: React.createElement(core_react_1.Icon, { iconSpec: React.createElement(itwinui_icons_react_1.SvgProgressBackwardCircular, null) }), title: this._backButtonTitle }),
                    React.createElement(itwinui_react_1.Text, { variant: "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