import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2007-2026 GoodData Corporation
import cx from "classnames";
import { useIntl } from "react-intl";
import { Button } from "../Button/Button.js";
/**
 * @internal
 */
export function Message({ id, onClose, type, children, className, contrast, intensive, dataTestId, }) {
    const intl = useIntl();
    const classes = cx("gd-message", "s-message", className, {
        success: type === "success",
        information: type === "progress",
        error: type === "error",
        warning: type === "warning",
        contrast,
        intensive,
    });
    const accessibilityAriaLabel = intl.formatMessage({
        id: "message.accessibility.dismiss.notification",
    });
    return (_jsx("div", { id: id, className: classes, "data-testid": dataTestId, children: _jsxs("div", { className: "gd-message-text", children: [children, onClose ? (_jsx(Button, { className: "gd-message-dismiss gd-icon-cross s-dialog-close-button", onClick: onClose, accessibilityConfig: {
                        ariaLabel: accessibilityAriaLabel,
                    } })) : null] }) }));
}
