/*---------------------------------------------------------------------------------------------
 * 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
 */
import "./ModalFrontstage.scss";
import * as React from "react";
import classnames from "classnames";
import { Text } from "@itwin/itwinui-react";
import { ModalFrontstageButton } from "./ModalFrontstageButton.js";
/** ModalFrontstage React component
 * @public
 */
export class ModalFrontstage extends React.Component {
    constructor(props) {
        super(props);
        this._onGoBack = () => {
            if (this.props.navigateBack)
                this.props.navigateBack();
            this.props.closeModal();
        };
    }
    render() {
        const classNames = classnames("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" },
                    this.props.backButton ? (this.props.backButton) : (React.createElement(ModalFrontstageButton, { onClick: this._onGoBack })),
                    React.createElement(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" })));
    }
}
//# sourceMappingURL=ModalFrontstage.js.map