import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2026 GoodData Corporation
import { throwUnexpected } from "@gooddata/sdk-model";
import { NumberParameterControlDropdown } from "./NumberParameterControlDropdown.js";
import { StringParameterControlDropdown } from "./StringParameterControlDropdown.js";
/**
 * Selects the parameter editing control by `definition.type` — the single seam where control
 * variants are dispatched. New parameter types get a sibling control and a new arm here.
 *
 * @internal
 */
export function ParameterControl({ name, definition, value, resetValue, inputId, ariaAttributes, onApply, onCancel, }) {
    switch (definition.type) {
        case "NUMBER":
            return (_jsx(NumberParameterControlDropdown, { name: name, value: Number(value), resetValue: resetValue === undefined ? undefined : Number(resetValue), constraints: definition.constraints, inputId: inputId, ariaAttributes: ariaAttributes, onApply: onApply, onCancel: onCancel }));
        case "STRING":
            return (_jsx(StringParameterControlDropdown, { name: name, value: String(value), resetValue: resetValue === undefined ? undefined : String(resetValue), constraints: definition.constraints, inputId: inputId, ariaAttributes: ariaAttributes, onApply: onApply, onCancel: onCancel }));
        default:
            return throwUnexpected(definition);
    }
}
