| 1 | /** |
| 2 | * The tabs under the header. Each shows its own part of the sidebar: the |
| 3 | * groups named in its `groups`, in the sidebar's order. A page belongs to |
| 4 | * the tab holding its group; the home page, in no group, to the first. |
| 5 | * The API reference tab takes every group not named here, since the |
| 6 | * operations' groups are named after the API's tags. |
| 7 | */ |
| 8 | export type Tab = { label: string; groups: string[] }; |
| 9 | |
| 10 | export const TABS: Tab[] = [ |
| 11 | { label: 'Get started', groups: ['Get started', 'About'] }, |
| 12 | { label: 'Coding agents', groups: ['Coding agents'] }, |
| 13 | { label: 'Chat', groups: ['Chat'] }, |
| 14 | { label: 'Code', groups: ['Landing changes', 'Security'] }, |
| 15 | { label: 'Projects', groups: ['Projects'] }, |
| 16 | { label: 'Workspaces', groups: ['Workspaces', 'Connect your tools'] }, |
| 17 | { label: 'Self-hosting', groups: ['Run g1t yourself'] }, |
| 18 | { label: 'Architecture', groups: ['Architecture'] }, |
| 19 | { label: 'API reference', groups: [] }, |
| 20 | ]; |
| 21 | |
| 22 | const API = TABS[TABS.length - 1]; |
| 23 | |
| 24 | /** The tab that holds the sidebar group with this label. */ |
| 25 | export function tabForGroup(label: string): Tab { |
| 26 | return TABS.find((tab) => tab.groups.includes(label)) ?? API; |
| 27 | } |