Build a traffic light that cycles through its phases on a timer and loops forever: green, then yellow, then red, then back to green. Each phase stays lit for its own length of time — green and red linger, yellow is brief. The whole exercise is about driving a state machine from time itself: there's no button to click, the component advances on its own and must keep doing so cleanly without leaking timers.
// A self-contained component. No props.
function App(): JSX.Element;
The light advances green → yellow → red → green … indefinitely, each phase lit for its configured duration.
t = 0s green (lit for 3s)
t = 3s yellow (lit for 1s)
t = 4s red (lit for 3s)
t = 7s green (and the cycle repeats)
Only one light is ever lit. The active phase decides which — the other two
are dimmed.