import * as React from 'react';
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
import { Box } from '../../../components/Flex';
import clsx from 'clsx';
import { TagList } from '../../../components/Tag/Tag';
export const renderScopeSummary = (data) => {
    const { api: { columnScopeApi: scopeApi }, } = useOnePageAdaptableWizardContext();
    const columnsInScope = scopeApi.getColumnsInScope(data.Scope);
    return (React.createElement(React.Fragment, null,
        React.createElement(Box, null,
            React.createElement(Box, { className: "twa:text-2" }, scopeApi.scopeIsAll(data.Scope)
                ? 'Changes to any Column in the row will trigger an Alert'
                : null)),
        React.createElement(Box, { className: "twa:overflow-hidden" }, 'ColumnIds' in data.Scope ? (React.createElement(React.Fragment, null,
            React.createElement(Box, { className: clsx('twa:text-2', columnsInScope.length ? 'twa:mb-2' : 'twa:mb-0') }, "Changes in selected columns will trigger an alert"),
            columnsInScope.length ? (React.createElement(TagList, { tags: columnsInScope.map((c) => c.friendlyName) })) : null)) : null),
        React.createElement(Box, null, 'DataTypes' in data.Scope ? (React.createElement(React.Fragment, null,
            React.createElement(Box, { className: "twa:text-2 twa:mb-2" }, "Changes in Columns with these Data Types trigger an Alert"),
            React.createElement(TagList, { tags: data.Scope.DataTypes.map((dataType) => {
                    return `DataType: ${dataType}`;
                }) }))) : null)));
};
