/*---------------------------------------------------------------------------------------------
 * 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 "./ModalFrontstageButton.scss";
import * as React from "react";
import { SvgProgressBackwardCircular } from "@itwin/itwinui-icons-react";
import { UiFramework } from "../UiFramework.js";
import { useTranslation } from "../hooks/useTranslation.js";
import { IconButton } from "@itwin/itwinui-react";
/** Button usually shown in the top-left corner of the modal frontstage. By default closes the modal frontstage.
 * @public
 */
export function ModalFrontstageButton(props) {
    const { translate } = useTranslation();
    const { label, icon, onClick } = props;
    const defaultLabel = translate("modalFrontstage.backButtonTitle");
    const defaultIcon = React.createElement(SvgProgressBackwardCircular, null);
    const defaultOnClick = React.useCallback(() => {
        UiFramework.frontstages.closeModalFrontstage();
    }, []);
    return (React.createElement(IconButton, { className: "uifw-frontstage-modalFrontstageButton", onClick: onClick ?? defaultOnClick, label: label ?? defaultLabel, iconProps: {
            className: "uifw-frontstage-modalFrontstageButton_icon",
        } }, icon ?? defaultIcon));
}
//# sourceMappingURL=ModalFrontstageButton.js.map