import { jsx as _jsx } from "react/jsx-runtime";
import { AmountField } from '../../../scalars/components/amount-field/index.js';
export const buildAmountCellEditor = (amountFieldProps) => {
    const AmountCellEditor = (value, onChange, context) => {
        // Convert value to Amount type if it's not already
        const amountValue = typeof value === 'object' && value !== null && 'value' in value
            ? value
            : { value: typeof value === 'number' ? value : undefined };
        return (_jsx(AmountField, { name: context.column.field, className: "max-w-full", autoFocus: true, type: "Amount", ...amountFieldProps, value: amountValue, onChange: (e) => {
                onChange(e.target.value);
            } }));
    };
    return AmountCellEditor;
};
//# sourceMappingURL=amount-editor.js.map