/*!
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project.
 */ import { jsx as _jsx } from "react/jsx-runtime";
import { NodeInput } from '@datashaper/workflow';
import { memo, useMemo } from 'react';
import { VerbForm } from '../verbForm/VerbForm.js';
import { inputColumnList, joinInputs, tableDropdown } from '../verbForm/VerbFormFactories.js';
/**
 * Provides inputs for a Lookup step.
 */ export const LookupBase = /*#__PURE__*/ memo(function LookupBase({ step , onChange , tableOptions , leftColumns , rightColumns ,  }) {
    const inputs = useMemo(()=>[
            tableDropdown('Join table', tableOptions, step.input[NodeInput.Other]?.node, (s, val)=>s.input[NodeInput.Other] = {
                    node: val
                }, {
                required: true,
                placeholder: 'Choose column'
            }),
            ...joinInputs(step, leftColumns, rightColumns),
            inputColumnList(step, rightColumns, 'Columns to copy')
        ], [
        step,
        leftColumns,
        rightColumns,
        tableOptions
    ]);
    return /*#__PURE__*/ _jsx(VerbForm, {
        inputs: inputs,
        onChange: onChange,
        step: step
    });
});
