Build an image carousel: a viewport showing one slide at a time, with Previous/Next controls and dot indicators. It's the "one of N" pattern again — a single index in state decides which slide shows — with one twist: the controls wrap around (Next on the last slide goes to the first), which is just modulo arithmetic.
// A self-contained component. No props.
function App(): JSX.Element;
A slide viewport, Prev/Next buttons, and clickable dots.
index 0, Next -> 1 -> 2 -> 3 -> Next wraps to 0
index 0, Prev -> wraps to 3 (last)
click dot 2 -> index = 2
the active dot reflects index; the shown slide is SLIDES[index]
SLIDES[index].(i + 1) % n; Prev: (i - 1 + n) % n (the + n keeps it non-negative).index; clicking sets index.