import { jsx as _jsx } from "react/jsx-runtime";
import { SelectField } from '../../../scalars/components/fragments/select-field/index.js';
import { normalizeEnumValue } from './utils.js';
export const buildEnumCellEditor = (selectFieldProps) => {
    const EnumCellEditor = (value, onChange, context) => {
        const enumValue = normalizeEnumValue(value);
        const props = {
            name: context.column.field,
            style: { maxWidth: context.column.maxWidth ?? context.column.width ?? '100%' },
            autoFocus: true,
            ...selectFieldProps,
            value: enumValue,
            onChange: (newValue) => {
                onChange(newValue);
            },
        };
        return _jsx(SelectField, { ...props });
    };
    return EnumCellEditor;
};
//# sourceMappingURL=enum-editor.js.map