import { jsx as _jsx } from "react/jsx-runtime";
import { NodeInput } from '@essex/dataflow';
import { memo, useMemo } from 'react';
import { VerbForm } from '../verbForm/VerbForm.js';
import { dropdown, inputColumnList, joinInputs } from '../verbForm/VerbFormFactories.js';
/**
 * Provides inputs for a Lookup step.
 */ export const LookupBase = /*#__PURE__*/ memo(function LookupBase({ step , onChange , tables , leftColumns , rightColumns ,  }) {
    const inputs = useMemo(()=>[
            dropdown('Join table', tables, step.input[NodeInput.Other]?.node, (s, val)=>s.input[NodeInput.Other] = {
                    node: val
                }, {
                required: true,
                placeholder: 'Choose column'
            }),
            ...joinInputs(step, leftColumns, rightColumns, 'lookup'),
            inputColumnList(step, rightColumns, 'Columns to copy'), 
        ], [
        step,
        leftColumns,
        rightColumns,
        tables
    ]);
    return /*#__PURE__*/ _jsx(VerbForm, {
        inputs: inputs,
        onChange: onChange,
        step: step
    });
});
