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

usageProviders.ts

27 lines990 Bytes

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"];
9​
10export const PROVIDER_LABEL: Record<UsageProviderKind, string> = {
11 claude: "Claude Code",
12 codex: "Codex",
13 grok: "Grok Build",
14};
15​
16/**
17 * Claude's brand orange holds in both themes; Codex and Grok are neutrals and
18 * must flip with the theme or their bars vanish against the matching background.
19 */
20export function useProviderColors(): Record<UsageProviderKind, string> {
21 const { themeAppearance: scheme } = useAppearancePreferences();
22 return {
23 claude: "#d97757",
24 codex: scheme === "dark" ? "#e6e6e6" : "#3c3c43",
25 grok: scheme === "dark" ? "#a1a1aa" : "#52525b",
26 };