in packages/react-heat-streams/src/components/CategoryNameList.tsx [21:63]
function CategoryNameList({
categories,
width,
rowHeight,
textColor,
categoryY,
isCategorySelected,
onClickCategory = NO_OP,
onClear = NO_OP,
}) {
const categoryNames = useMemo(
() =>
categories.map((cat, index) => (
<CategoryName
key={cat.id}
category={cat}
height={rowHeight}
textColor={textColor}
selected={isCategorySelected(cat)}
onClick={onClickCategory}
y={categoryY(index) + rowHeight - 1}
/>
)),
[
categories,
isCategorySelected,
categoryY,
onClickCategory,
rowHeight,
textColor,
],
)
return (
<g className="category-names">
<rect
className="category-name-occluder"
width={width}
onClick={onClear}
/>
<g className="category-texts">{categoryNames}</g>
</g>
)
},