import { jsx as _jsx } from "react/jsx-runtime";
import { num } from '@data-wrangling-components/utilities';
import { memo, useMemo } from 'react';
import { FormInputType, VerbForm } from '../verbForm/VerbForm.js';
/**
 * Provides inputs for a Fetch step.
 */ export const FetchBase = /*#__PURE__*/ memo(function FetchBase({ step , onChange  }) {
    const inputs = useMemo(()=>[
            {
                label: 'URL',
                type: FormInputType.Text,
                placeholder: 'URL to dataset',
                current: step.args.url,
                required: true,
                onChange: (s, val)=>s.args.url = val
            },
            {
                label: 'Delimiter',
                type: FormInputType.Text,
                placeholder: 'Column delimiter',
                current: step.args.delimiter,
                onChange: (s, val)=>s.args.delimiter = val
            },
            {
                label: 'Automax',
                type: FormInputType.NumberSpinner,
                min: 0,
                max: 10000000,
                step: 1,
                current: step.args.autoMax,
                onChange: (s, val)=>s.args.autoMax = num(val)
            }, 
        ], [
        step
    ]);
    return /*#__PURE__*/ _jsx(VerbForm, {
        inputs: inputs,
        step: step,
        onChange: onChange
    });
});
