import { jsx as _jsx } from "react/jsx-runtime";
import { memo, useMemo } from 'react';
import { createRowEntries } from '../verbForm/createRowEntries.js';
import { VerbDescription } from '../verbForm/VerbDescription.js';
export const SetOperationDescription = /*#__PURE__*/ memo(function SetOperationDescription(props) {
    const rows = useMemo(()=>{
        const internal = props.step;
        const others = otherInputNames(internal);
        const sub = createRowEntries(others, (o)=>({
                value: o
            }), 1, props);
        return [
            {
                before: 'with',
                value: others.length > 0 ? '' : null,
                sub
            }, 
        ];
    }, [
        props
    ]);
    return /*#__PURE__*/ _jsx(VerbDescription, {
        ...props,
        rows: rows
    });
});
export function otherInputNames(step) {
    return (step.input.others || []).map((i)=>i.node);
}
