Open this example in the interactive library
Source code
// app/issues/page.tsx
export default function TriageWorkloadByOwner() {
const issues = [
{ id: 12, title: "Header spacing", owner: "Kim", severity: 1, open: true },
{ id: 14, title: "Invoice rounding", owner: "Sam", severity: 3, open: true },
{ id: 21, title: "Alt text", owner: "Kim", severity: 2, open: false },
];
return (
<ul>
{[...new Set(issues.map((i) => i.owner))].map((o) => (
<li key={o}>
{o}:{" "}
{issues
.filter((i) => i.owner === o && i.open)
.reduce((s, i) => s + i.severity, 0)}{" "}
severity points
</li>
))}
</ul>
);
}
