Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

usageProviders.ts

31 lines1.1 KB

1import type { UsageProviderKind } from "@t3tools/contracts";
2import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
3​
4/**
5 * Series and table order. The chart stacks providers from the bottom in this
6 * order, so it also fixes which band sits on top of the bars.
7 */
8export const PROVIDER_ORDER: readonly UsageProviderKind[] = ["codex", "claude", "grok", "devin"];
9​
10export const PROVIDER_LABEL: Record<UsageProviderKind, string> = {
11 claude: "Claude Code",
12 codex: "Codex",
13 grok: "Grok Build",
14 devin: "Devin ACP",
15};
16​
17/**
18 * Claude's brand orange holds in both themes; Codex and Grok are neutrals and
19 * must flip with the theme or their bars vanish against the matching background.
20 * Devin uses its indigo accent in both themes so its provider band remains
21 * distinct from the neutral providers.
22 */
23export function useProviderColors(): Record<UsageProviderKind, string> {
24 const { themeAppearance: scheme } = useAppearancePreferences();
25 return {
26 claude: "#d97757",
27 codex: scheme === "dark" ? "#e6e6e6" : "#3c3c43",
28 grok: scheme === "dark" ? "#a1a1aa" : "#52525b",
29 devin: "#6b7cff",
30 };