Open this example in the interactive library
Live preview
Source code
// components/EmptyBinLocator.tsx
export default function EmptyBinLocator({
counts = [12, 0, 5, 18],
}: { counts?: number[] } = {}) {
return (
<ul>
{counts.flatMap((n, i) =>
n === 0 ? [<li key={i}>Bin {i + 1} is empty</li>] : [],
)}
</ul>
);
}
