import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import cx from "classnames";
import { injectIntl } from "react-intl";
import { stringUtils } from "@gooddata/util";
export function CoreHeaderWorkspacePickerItem({ intl, title, isLoading, isSelected, isDemo, onClick, }) {
    const t = intl.formatMessage;
    if (isLoading) {
        return (_jsx("div", { className: "gd-list-item gd-project-list-item gd-is-loading", children: _jsx("div", { className: "gd-spinner small" }) }));
    }
    const classes = cx({
        "gd-list-item": true,
        "gd-project-list-item": true,
        [`s-${stringUtils.simplifyText(title)}`]: true,
        "gd-is-selected": isSelected,
        "gd-is-demo": isDemo,
    });
    return (_jsxs("button", { className: classes, title: title, onClick: onClick, children: [_jsx("span", { className: "project-title", children: title }), isDemo ? (_jsx("span", { className: "demo-sticker", children: t({ id: "gs.header.projectPicker.demo" }) })) : null] }));
}
export const HeaderWorkspacePickerItem = injectIntl(CoreHeaderWorkspacePickerItem);
//# sourceMappingURL=HeaderWorkspacePickerItem.js.map