'use strict';

var React = require('react');
var DataListContext = require('./DataListContext-cjs.js');
var DataListLayoutContext = require('./DataListLayoutContext-cjs.js');
var DataListItem = require('./DataListItem-cjs.js');

function DataListItems({ size = "xs", }) {
    const { data, layouts } = DataListContext.useDataListContext();
    const [hasInLayoutActions, setHasInLayoutActions] = React.useState(false);
    const layout = layouts[size];
    if (!layout)
        return null;
    return (React.createElement(DataListLayoutContext.DataListLayoutContext.Provider, { value: {
            isInLayoutProvider: true,
            hasInLayoutActions,
            setHasInLayoutActions,
        } }, data.map((child, i) => (React.createElement(DataListItem.DataListItem, { key: data[i].id, index: i, item: child, layout: layout })))));
}

exports.DataListItems = DataListItems;
