| 80 | } |
| 81 | }; |
| 82 | const moveTab = (event: KeyboardEvent<HTMLButtonElement>, current: SystemTab) => { |
| 83 | const index = TABS.indexOf(current); |
| 84 | const target = event.key === 'ArrowDown' ? TABS[(index + 1) % TABS.length] |
| 85 | : event.key === 'ArrowUp' ? TABS[(index + TABS.length - 1) % TABS.length] |
| 86 | : event.key === 'Home' ? TABS[0] : event.key === 'End' ? TABS[TABS.length - 1] : undefined; |
| 87 | if (!target) return; |
| 88 | event.preventDefault(); |
| 89 | setTab(target); |
| 90 | document.getElementById(`system-tab-${target}`)?.focus(); |
| 91 | }; |
| 92 | |
| 93 | return <section className="system-workspace" aria-label="System" hidden={!active} data-testid="system-workspace"> |
| 94 | <header className="system-heading"> |