import { jsx as _jsx } from "react/jsx-runtime";
import { MergeStrategy } from '@data-wrangling-components/core';
import { memo, useMemo } from 'react';
import { FormInputType, VerbForm } from '../verbForm/VerbForm.js';
import { enumDropdown, inputColumnList } from '../verbForm/VerbFormFactories.js';
/**
 * Just the to/value inputs for an impute.
 * Input table is expected to be edited elsewhere and configured as the step input.
 */ export const MergeBase = /*#__PURE__*/ memo(function MergeBase({ step , onChange , columns  }) {
    const inputs = useMemo(()=>[
            inputColumnList(step, columns),
            enumDropdown('Merge strategy', MergeStrategy, step.args.strategy, (s, val)=>s.args.strategy = val, {
                required: true,
                placeholder: 'Choose strategy'
            }),
            {
                label: 'Delimiter',
                type: FormInputType.Text,
                if: step.args.strategy === MergeStrategy.Concat,
                current: step.args.delimiter,
                onChange: (s, val)=>s.args.delimiter = val
            }, 
        ], [
        step,
        columns
    ]);
    return /*#__PURE__*/ _jsx(VerbForm, {
        inputs: inputs,
        step: step,
        onChange: onChange
    });
});
