import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2022-2025 GoodData Corporation
import { memo } from "react";
import cx from "classnames";
import { useIntl } from "react-intl";
import { IntlWrapper } from "@gooddata/sdk-ui";
import { Button } from "../Button/index.js";
const DialogCloseButtonCore = memo(function DialogCloseButton({ className, accessibilityConfig, onClose, }) {
    const intl = useIntl();
    const closeButtonAccessibilityConfig = {
        ariaLabel: intl.formatMessage({ id: "dialogs.closeLabel" }),
        ariaDescribedBy: accessibilityConfig?.titleElementId,
        ...accessibilityConfig?.closeButton,
    };
    return (_jsx("div", { className: "gd-dialog-close", children: _jsx(Button, { className: cx("gd-button-link gd-button-icon-only gd-icon-cross s-dialog-close-button", className), onClick: onClose, accessibilityConfig: closeButtonAccessibilityConfig }) }));
});
/**
 * @internal
 */
export function DialogCloseButton(props) {
    return (_jsx(IntlWrapper, { children: _jsx(DialogCloseButtonCore, { ...props }) }));
}
//# sourceMappingURL=DialogCloseButton.js.map