Build a pagination control as a single React component. There are five pages. It looks like several independent buttons, but doing it right means one number — the current page — is the source of truth, and the highlighted page, the disabled ends, and the status line all read from it.
The starter App.tsx renders the pager in its page 1 state. Make it interactive (totalPages = 5):
useState(1).goTo(p) sets the current page, clamped to [1, 5]. Prev goes to current - 1, Next to current + 1 — the clamp keeps them in range.current gets the active class; Prev is disabled on page 1 and Next on page 5; the status line reads Page 3 of 5.1 highlighted, Prev disabled, and "Page 1 of 5". Clicking 3 highlights 3 and shows "Page 3 of 5".current.Math.min/Math.max inside goTo, so Prev, Next, and any direct jump all stay in [1, 5] for free.styles.css; focus on the state.