Build a GitHub-style contribution heatmap in React. Eighty-four days sit in a grid of 7 rows (days of the week) and 12 columns (weeks); each day cell is shaded by an activity level from 0 to 4, and hovering a cell writes that day's count into a status line below the grid.
The starter App.tsx already builds the days array and renders the coloured grid, the legend, and a Hover a day status. Make it interactive:
hovered index with useState<number | null>(null).onMouseEnter={() => setHovered(d.i)} to each cell.hovered is set, show count contributions — day i for that day; otherwise show Hover a day.Less to More legend on the right, and Hover a day underneath.3 contributions — day 45.level = (i * 3 + (i % 7)) % 5 and count = level * 2 + (i % 3) — no Math.random, so the picture is stable on every render. Build the array once, outside the component.grid-auto-flow: column fills the array column by column. You never compute x/y positions.cell l${level}; the five .l0–.l4 shades live in styles.css.styles.css; focus on the hover state.