Pure helper: convert a tab index into the new value the
discriminated union should emit. Returns undefined when the index
is out of bounds — callers skip the onChange call entirely.
Extracted so the contract is unit-testable without rendering the
tabs component.
Pure helper: convert a tab index into the new value the discriminated union should emit. Returns
undefinedwhen the index is out of bounds — callers skip theonChangecall entirely.Extracted so the contract is unit-testable without rendering the tabs component.