import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { memo, useCallback } from 'react';
import { ContentItem } from '../ContentItem/index.js';
import { VirtualList } from './VirtualList.js';
function ItemsComponent({ items, routingBasePath }) {
    const renderItem = useCallback((item) => (_jsx(ContentItem, { item: item, routingBasePath: routingBasePath, children: item.items.length > 0 && (_jsx(VirtualList, { items: item.items, renderItem: renderItem, routingBasePath: routingBasePath })) }, item.id)), [routingBasePath]);
    if (!items.length)
        return null;
    const shouldUseVirtualList = items.length > 15 && items.every((item) => item.type === 'operation' || item.type === 'schema');
    return (_jsx(_Fragment, { children: shouldUseVirtualList ? (_jsx(VirtualList, { items: items, renderItem: renderItem, routingBasePath: routingBasePath })) : (_jsx(_Fragment, { children: items.map(renderItem) })) }));
}
export const Items = memo(ItemsComponent);
//# sourceMappingURL=Items.js.map