import * as React from 'react';
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
import { NewScopeComponent } from '../../Components/NewScopeComponent';
export const ShortcutScopeWizardSection = (props) => {
    const { data, api } = useOnePageAdaptableWizardContext();
    const availableColumns = React.useMemo(() => api.columnApi.getNumericColumns(), []);
    return (React.createElement(NewScopeComponent, { availableDataTypes: ['number'], scopeColumns: availableColumns, scope: data.Scope, descriptions: {
            rowScope: 'All Numeric Columns will have the Shortcut applied',
            columnScope: 'Selected Columns will have the Shortcut applied',
        }, updateScope: (Scope) => {
            let preparedScope = Scope;
            if (Scope && 'DataTypes' in Scope && Scope.DataTypes.length === 0) {
                // default to checked
                preparedScope = {
                    ...Scope,
                    DataTypes: ['number'],
                };
            }
            props.onChange({
                ...data,
                Scope: preparedScope,
            });
        } }));
};
