|
1 | 1 | import { useEffect, useRef, useState, type KeyboardEvent } from "react"; |
2 | 2 | import { navigateHash, normalizeHashPath } from "../hash-routing"; |
3 | | -import { useT, type TKey } from "../i18n/shared"; |
| 3 | +import { useT } from "../i18n/shared"; |
4 | 4 | import ApiKeys from "./ApiKeys"; |
5 | 5 | import Claude from "./Claude"; |
6 | 6 | import Grok from "./Grok"; |
7 | 7 | import IntegrationsOverview from "./integrations/IntegrationsOverview"; |
8 | 8 | import FileIntegrationPage, { |
9 | 9 | type FileIntegrationClientId, |
10 | 10 | } from "./integrations/FileIntegrationPage"; |
11 | | - |
12 | | -type IntegrationTab = |
13 | | - | "overview" |
14 | | - | "keys" |
15 | | - | "codex" |
16 | | - | "claude" |
17 | | - | "grok" |
18 | | - | FileIntegrationClientId; |
19 | | - |
20 | | -interface TabDefinition { |
21 | | - id: IntegrationTab; |
22 | | - hash: string; |
23 | | - labelKey: TKey; |
24 | | -} |
25 | | - |
26 | | -const TABS: readonly TabDefinition[] = [ |
27 | | - { id: "overview", hash: "integrations", labelKey: "integrations.tab.overview" }, |
28 | | - { id: "keys", hash: "integrations/keys", labelKey: "integrations.tab.keys" }, |
29 | | - { id: "codex", hash: "integrations/codex", labelKey: "integrations.tab.codex" }, |
30 | | - { id: "claude", hash: "integrations/claude", labelKey: "integrations.tab.claude" }, |
31 | | - { id: "grok", hash: "integrations/grok", labelKey: "integrations.tab.grok" }, |
32 | | - { id: "opencode", hash: "integrations/opencode", labelKey: "integrations.tab.opencode" }, |
33 | | - { id: "pi", hash: "integrations/pi", labelKey: "integrations.tab.pi" }, |
34 | | - { id: "omp", hash: "integrations/omp", labelKey: "integrations.tab.omp" }, |
35 | | - { id: "hermes", hash: "integrations/hermes", labelKey: "integrations.tab.hermes" }, |
36 | | - { id: "openclaw", hash: "integrations/openclaw", labelKey: "integrations.tab.openclaw" }, |
37 | | - { id: "kimi", hash: "integrations/kimi", labelKey: "integrations.tab.kimi" }, |
38 | | - { id: "gajae", hash: "integrations/gajae", labelKey: "integrations.tab.gajae" }, |
39 | | - { id: "dsh", hash: "integrations/dsh", labelKey: "integrations.tab.dsh" }, |
40 | | - { id: "mcode", hash: "integrations/mcode", labelKey: "integrations.tab.mcode" }, |
41 | | - { id: "zcode", hash: "integrations/zcode", labelKey: "integrations.tab.zcode" }, |
42 | | - { id: "prime", hash: "integrations/prime", labelKey: "integrations.tab.prime" }, |
43 | | -] as const; |
44 | | - |
45 | | -const FILE_CLIENTS = new Set<FileIntegrationClientId>([ |
46 | | - "opencode", |
47 | | - "pi", |
48 | | - "omp", |
49 | | - "hermes", |
50 | | - "openclaw", |
51 | | - "kimi", |
52 | | - "gajae", |
53 | | - "dsh", |
54 | | - "mcode", |
55 | | - "zcode", |
56 | | - "prime", |
57 | | -]); |
| 11 | +import { FILE_CLIENTS, TABS, type IntegrationTab } from "./integrations/integration-tabs"; |
58 | 12 |
|
59 | 13 | function readIntegrationTab(hash = window.location.hash): IntegrationTab { |
60 | 14 | const raw = normalizeHashPath(hash); |
|
0 commit comments