"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 Notification
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToastMessage = void 0;
const React = require("react");
const appui_layout_react_1 = require("@itwin/appui-layout-react");
const MessageLabel_1 = require("./MessageLabel");
const HollowIcon_1 = require("./HollowIcon");
const core_react_1 = require("@itwin/core-react");
/** Toast Message React component
 * @public
 * @deprecated in 3.3. Replaced by Toaster from @itwin/itwinui-react.
 */
function ToastMessage(props) {
    const { id, messageDetails, severity, toastTarget, closeMessage } = props;
    return (React.createElement(appui_layout_react_1.Toast // eslint-disable-line deprecation/deprecation
    , { animateOutTo: toastTarget, onAnimatedOut: () => closeMessage(id), timeout: messageDetails.displayTime.milliseconds, content: React.createElement(appui_layout_react_1.Message // eslint-disable-line deprecation/deprecation
        , { status: appui_layout_react_1.StatusHelpers.severityToStatus(severity), icon: React.createElement(HollowIcon_1.HollowIcon, { iconSpec: core_react_1.MessageContainer.getIconClassName(severity, true) }) },
            React.createElement(appui_layout_react_1.MessageLayout, null,
                React.createElement(MessageLabel_1.MessageLabel, { message: messageDetails.briefMessage, className: "uifw-statusbar-message-brief" }),
                messageDetails.detailedMessage &&
                    React.createElement(MessageLabel_1.MessageLabel, { message: messageDetails.detailedMessage, className: "uifw-statusbar-message-detailed" }))) }));
}
exports.ToastMessage = ToastMessage;
//# sourceMappingURL=ToastMessage.js.map