import * as React from 'react';
import { DataSource, InfiniteTableGrid, } from '../../../components/InfiniteTable';
import join from '../../utils/join';
const baseClassName = 'ab-GridList';
const columnsMap = {
    item: { field: 'item', header: null, defaultFlex: 1 },
};
const GridList = (props) => {
    const data = React.Children.map(props.children, (c, index) => {
        return {
            item: c,
            id: index,
        };
    }).filter((data) => !!data.item);
    return (React.createElement(DataSource, { data: data, primaryKey: "id" },
        React.createElement(InfiniteTableGrid, { header: false, showZebraRows: props.showZebraRows, rowHeight: props.rowHeight ?? '--ab-grid-row-height', domProps: {
                className: join(baseClassName, props.className),
                style: {
                    minHeight: '15rem',
                },
            }, columns: columnsMap })));
};
export default GridList;
