import React from 'react'; import StyledWrapper from './StyledWrapper'; function countRequests(items) { let count = 0; function recurse(item) { if (item && typeof item === 'object') { if (item.type !== 'folder') { count++; } if (Array.isArray(item.items)) { item.items.forEach(recurse); } } } items.forEach(recurse); return count; } const Info = ({ collection }) => { return (
General information about the collection.
Name : {collection.name}
Location : {collection.pathname}
Ignored files : {collection.brunoConfig.ignore.map((x) => `'${x}'`).join(', ')}
Environments : {collection.environments?.length || 0}
Requests : {countRequests(collection.items)}
); }; export default Info;