Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ui/assets/provider-logos/copilot-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/ui/assets/provider-logos/copilot-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion src/ui/assets/provider-logos/cursor-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/ui/assets/provider-logos/cursor-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion src/ui/assets/provider-logos/openai-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/ui/assets/provider-logos/openai-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/ui/assets/provider-logos/opencode-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/ui/assets/provider-logos/opencode-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/ui/assets/provider-logos/pi-on-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 31 additions & 8 deletions src/ui/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,40 @@ export const toolIcons = {
export type ToolIcon = IconNode;

const providerLogos = {
claude: new URL("./assets/provider-logos/claude.svg", import.meta.url).href,
codex: new URL("./assets/provider-logos/openai-dark.svg", import.meta.url).href,
copilot: new URL("./assets/provider-logos/copilot-dark.svg", import.meta.url).href,
cursor: new URL("./assets/provider-logos/cursor-dark.svg", import.meta.url).href,
opencode: new URL("./assets/provider-logos/opencode-dark.svg", import.meta.url).href,
pi: new URL("./assets/provider-logos/pi-on-dark.svg", import.meta.url).href,
claude: {
light: new URL("./assets/provider-logos/claude.svg", import.meta.url).href,
dark: new URL("./assets/provider-logos/claude.svg", import.meta.url).href,
},
codex: {
light: new URL("./assets/provider-logos/openai-light.svg", import.meta.url).href,
dark: new URL("./assets/provider-logos/openai-dark.svg", import.meta.url).href,
},
copilot: {
light: new URL("./assets/provider-logos/copilot-light.svg", import.meta.url).href,
dark: new URL("./assets/provider-logos/copilot-dark.svg", import.meta.url).href,
},
cursor: {
light: new URL("./assets/provider-logos/cursor-light.svg", import.meta.url).href,
dark: new URL("./assets/provider-logos/cursor-dark.svg", import.meta.url).href,
},
opencode: {
light: new URL("./assets/provider-logos/opencode-light.svg", import.meta.url).href,
dark: new URL("./assets/provider-logos/opencode-dark.svg", import.meta.url).href,
},
pi: {
light: new URL("./assets/provider-logos/pi-on-light.svg", import.meta.url).href,
dark: new URL("./assets/provider-logos/pi-on-dark.svg", import.meta.url).href,
},
} as const;

export function getProviderLogo(name: string): string | undefined {
export type ProviderLogoTheme = "light" | "dark";

export function getProviderLogo(
name: string,
theme: ProviderLogoTheme = "dark",
): string | undefined {
const normalizedName = name.trim().toLowerCase() as keyof typeof providerLogos;
return providerLogos[normalizedName];
return providerLogos[normalizedName]?.[theme];
}

export function renderIcon(icon: ToolIcon, className = "icon-svg"): SVGElement {
Expand Down
Loading
Loading