import React from 'react';
import { translate, rings } from '../../common/config';
import Badge from './Badge';
import Item from './Item';
import Link from './Link';
const renderList = (ringName, quadrantName, groups, big) => {
const itemsInRing = groups[quadrantName][ringName];
if (big === true) {
return (
{ringName}
{
itemsInRing.map(item => (
))
}
);
}
return (
{ringName}
{
itemsInRing.map(item => (
{item.title}
))
}
);
}
const renderRing = (ringName, quadrantName, groups, big) => {
if (!groups[quadrantName][ringName] || groups[quadrantName][ringName].length === 0) {
return null;
}
return (
{renderList(ringName, quadrantName, groups, big)}
);
}
export default function QuadrantSection({ quadrantName, groups, big = false }) {
return (
{translate(quadrantName)}
{
!big && (
Quadrant Overview
)
}
{
rings.map((ringName) => renderRing(ringName, quadrantName, groups, big))
}
);
}