import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2024-2025 GoodData Corporation
import cx from "classnames";
import { FormattedMessage } from "react-intl";
import { getGranularPermissionTitle, granularTooltipMessages } from "./locales.js";
import { QuestionMarkIcon } from "./QuestionMarkIcon.js";
export function WorkspaceAccessPermissionItem({ item, checked, onChange, }) {
    return (_jsx("div", { children: _jsxs("label", { className: "input-radio-label", children: [
                _jsx("input", { type: "radio", className: "input-radio", name: "workspace-access-permission", checked: checked, onChange: onChange }), _jsx("span", { className: "input-label-text", children: _jsx(FormattedMessage, { id: getGranularPermissionTitle(item).id }) })
            ] }) }));
}
export function AdditionalAccessPermissionItem({ item, checked, indefinite, disabled, onChange, }) {
    return (_jsxs("div", { className: "gd-granular-permissions__additional-access-item", children: [item.group ? _jsx("div", { className: "gd-granular-permissions__additional-access-item-indent" }) : null, _jsxs("label", { className: "input-checkbox-label", children: [
                    _jsx("input", { type: "checkbox", className: cx("input-checkbox", { "checkbox-indefinite": indefinite }), name: "additional-access-permission", checked: checked || indefinite, onChange: onChange, disabled: disabled }), _jsx("span", { className: "input-label-text", children: _jsx(FormattedMessage, { id: getGranularPermissionTitle(item.id).id }) })
                ] }), _jsx("div", { className: "gd-granular-permissions__additional-access-item-info", children: item.id in granularTooltipMessages && (_jsx(QuestionMarkIcon, { bubbleTextId: granularTooltipMessages[item.id].id, width: 14, height: 14 })) })
        ] }));
}
//# sourceMappingURL=GranularPermissionsItems.js.map