import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2022-2026 GoodData Corporation
import { useCallback } from "react";
import { FormattedMessage } from "react-intl";
import { dialogChangeMessageLabels } from "../../../../locales.js";
import { ComponentTypeItem } from "./ComponentTypeItem.js";
/**
 * @internal
 */
export function ComponentTypeSelect({ selectedComponentType, onComponentTypeChanged, }) {
    const onCheck = useCallback((e) => {
        const value = e.target.value;
        onComponentTypeChanged(value);
    }, [onComponentTypeChanged]);
    return (_jsxs("div", { className: "embed-insight-dialog-lang-selector", children: [
            _jsx("strong", { className: "bottom-space", children: _jsx(FormattedMessage, { id: "embedInsightDialog.component.type" }) }), _jsx(ComponentTypeItem, { className: "s-component-type-reference", itemText: "Referential", itemValue: "reference", onChange: onCheck, checked: selectedComponentType === "reference", questionMarkMessage: getChangesLabelId("reference") }), _jsx(ComponentTypeItem, { className: "s-component-type-definition", itemText: "Programmatic", itemValue: "definition", onChange: onCheck, checked: selectedComponentType === "definition", questionMarkMessage: getChangesLabelId("definition") })
        ] }));
}
const getChangesLabelId = (codeType) => {
    return dialogChangeMessageLabels[codeType].id;
};
