/*---------------------------------------------------------------------------------------------
 * 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 classnames from "classnames";
import * as React from "react";
import { Icon } from "@itwin/core-react";
import { BackButton } from "@itwin/appui-layout-react";
import { UiFramework } from "../UiFramework";
import { Text } from "@itwin/itwinui-react";
import { SvgProgressBackwardCircular } from "@itwin/itwinui-icons-react";
/**
 * ModalFrontstage React component
 * @public
 */
export class ModalFrontstage extends React.Component {
    constructor(props) {
        super(props);
        this._backButtonTitle = UiFramework.translate("modalFrontstage.backButtonTitle");
        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" },
                    React.createElement(BackButton, { className: "nz-toolbar-button-app", onClick: this._onGoBack, icon: React.createElement(Icon, { iconSpec: React.createElement(SvgProgressBackwardCircular, null) }), title: this._backButtonTitle }),
                    React.createElement(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" })));
    }
}
//# sourceMappingURL=ModalFrontstage.js.map