import { jsx as _jsx } from "react/jsx-runtime";
import { JoinStrategy } from '@data-wrangling-components/core';
import { NodeInput } from '@essex/dataflow';
import { memo, useMemo } from 'react';
import { VerbForm } from '../verbForm/VerbForm.js';
import { dropdown, enumDropdown, joinInputs } from '../verbForm/VerbFormFactories.js';
/**
 * Provides inputs for a Join step.
 */ export const JoinBase = /*#__PURE__*/ memo(function JoinBase({ 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
                }),
            enumDropdown('Join strategy', JoinStrategy, step.args.strategy, (s, val)=>s.args.strategy = val),
            ...joinInputs(step, leftColumns, rightColumns), 
        ], [
        step,
        leftColumns,
        rightColumns,
        tables
    ]);
    return /*#__PURE__*/ _jsx(VerbForm, {
        step: step,
        onChange: onChange,
        inputs: inputs
    });
});
