/*!
 * 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 } from 'react';
import { useDataTable, useTableColumnNames } from '../hooks/index.js';
import { useTableDropdownOptions } from '../hooks/useTableDropdownOptions.js';
import { JoinBase } from './Join.base.js';
/**
 * Provides inputs for a Join step.
 */ export const Join = /*#__PURE__*/ memo(function Join({ step , workflow , input , onChange ,  }) {
    const tableOptions = useTableDropdownOptions(workflow);
    const leftTable = useDataTable(input || step.input[NodeInput.Source]?.node, workflow);
    const rightTable = useDataTable(step.input[NodeInput.Other]?.node, workflow);
    const leftColumns = useTableColumnNames(leftTable);
    const rightColumns = useTableColumnNames(rightTable);
    return /*#__PURE__*/ _jsx(JoinBase, {
        step: step,
        onChange: onChange,
        tableOptions: tableOptions,
        leftColumns: leftColumns,
        rightColumns: rightColumns
    });
});
