import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
import cx from "classnames";
import { simplifyText } from "@gooddata/util";
import { Button } from "../Button/Button.js";
export function HeaderWorkspacePickerButton({ title, onClick, isOpen, buttonRef, accessibilityConfig, }) {
    const classNames = cx({
        "gd-header-project": true,
        [`s-${simplifyText(title)}`]: true,
        "is-expanded": isOpen,
        "is-collapsed": !isOpen,
    });
    return (_jsx(Button, { ref: buttonRef, className: "gd-header-button gd-workspace-picker-button", onClick: onClick, title: title, accessibilityConfig: accessibilityConfig, children: _jsx("div", { className: classNames, children: title?.trim().length > 0 ? title : _jsx(_Fragment, { children: "\u00A0" }) }) }));
}
