import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2021-2025 GoodData Corporation
import { useState } from "react";
import { HeaderBadge } from "./HeaderBadge.js";
/**
 * @internal
 */
export function HeaderBadgeWithModal({ renderModalContent, children, color, ...badgeProps }) {
    const [isModalOpen, setIsModalOpen] = useState(false);
    return (_jsxs(HeaderBadge, { ...badgeProps, children: [
            _jsx("button", { type: "button", style: { color }, className: "gd-header-badge-button", onClick: () => setIsModalOpen(true), children: children }), isModalOpen ? renderModalContent({ closeModal: () => setIsModalOpen(false) }) : null] }));
}
