import { jsx as _jsx } from "react/jsx-runtime";
import { MathOperator } from '@data-wrangling-components/core';
import { memo, useMemo } from 'react';
import { useSimpleDropdownOptions } from '../hooks/index.js';
import { FormInputType, VerbForm } from '../verbForm/VerbForm.js';
import { enumDropdown } from '../verbForm/VerbFormFactories.js';
/**
 * Provides inputs for a Binarize step.
 */ export const DeriveBase = /*#__PURE__*/ memo(function DeriveBase({ step , onChange , columns  }) {
    const options = useSimpleDropdownOptions(columns);
    const inputs = useMemo(()=>[
            {
                label: 'Column one',
                type: FormInputType.SingleChoice,
                current: step.args.column1,
                required: true,
                options,
                onChange: (s, arg)=>s.args.column1 = arg
            },
            enumDropdown('Operation', MathOperator, step.args.operator, (s, arg)=>s.args.operator = arg, {
                required: true
            }),
            {
                label: 'Column two',
                type: FormInputType.SingleChoice,
                options,
                current: step.args.column2,
                onChange: (s, arg)=>s.args.column2 = arg
            }, 
        ], [
        step,
        options
    ]);
    return /*#__PURE__*/ _jsx(VerbForm, {
        inputs: inputs,
        step: step,
        onChange: onChange
    });
});
