mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 10:21:16 +08:00
fix(openclaw): add openclaw to all Record<AppId, T> usages
Expand McpApps interface, APP_IDS, APP_ICON_MAP, enabledCounts initializers, and test mock data to include the openclaw key, resolving TypeScript errors after AppId union was extended.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import React from "react";
|
||||
import type { AppId } from "@/lib/api/types";
|
||||
import { ClaudeIcon, CodexIcon, GeminiIcon } from "@/components/BrandIcons";
|
||||
import {
|
||||
ClaudeIcon,
|
||||
CodexIcon,
|
||||
GeminiIcon,
|
||||
OpenClawIcon,
|
||||
} from "@/components/BrandIcons";
|
||||
import { ProviderIcon } from "@/components/ProviderIcon";
|
||||
|
||||
export interface AppConfig {
|
||||
@@ -10,7 +15,7 @@ export interface AppConfig {
|
||||
badgeClass: string;
|
||||
}
|
||||
|
||||
export const APP_IDS: AppId[] = ["claude", "codex", "gemini", "opencode"];
|
||||
export const APP_IDS: AppId[] = ["claude", "codex", "gemini", "opencode", "openclaw"];
|
||||
|
||||
export const APP_ICON_MAP: Record<AppId, AppConfig> = {
|
||||
claude: {
|
||||
@@ -52,4 +57,12 @@ export const APP_ICON_MAP: Record<AppId, AppConfig> = {
|
||||
badgeClass:
|
||||
"bg-indigo-500/10 text-indigo-700 dark:text-indigo-300 hover:bg-indigo-500/20 border-0 gap-1.5",
|
||||
},
|
||||
openclaw: {
|
||||
label: "OpenClaw",
|
||||
icon: <OpenClawIcon size={14} />,
|
||||
activeClass:
|
||||
"bg-rose-500/10 ring-1 ring-rose-500/20 hover:bg-rose-500/20 text-rose-600 dark:text-rose-400",
|
||||
badgeClass:
|
||||
"bg-rose-500/10 text-rose-700 dark:text-rose-300 hover:bg-rose-500/20 border-0 gap-1.5",
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user