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

usageProviders.ts

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