Co-authored-by: Dara Adedeji <[email protected]> Co-authored-by: Ahmed Besic <[email protected]> Co-authored-by: Michael Brown <[email protected]> Co-authored-by: Lars Nieuwenhuis <[email protected]> Co-authored-by: Guilherme Barros <[email protected]> Co-authored-by: PC <pc@localhost> Co-authored-by: 1xpixi <[email protected]>
28 lines
990 B
TypeScript
28 lines
990 B
TypeScript
import type { UsageProviderKind } from "@t3tools/contracts";
|
|
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
|
|
|
|
/**
|
|
* Series and table order. The chart stacks providers from the bottom in this
|
|
* order, so it also fixes which band sits on top of the bars.
|
|
*/
|
|
export const PROVIDER_ORDER: readonly UsageProviderKind[] = ["codex", "claude", "grok"];
|
|
|
|
export const PROVIDER_LABEL: Record<UsageProviderKind, string> = {
|
|
claude: "Claude Code",
|
|
codex: "Codex",
|
|
grok: "Grok Build",
|
|
};
|
|
|
|
/**
|
|
* Claude's brand orange holds in both themes; Codex and Grok are neutrals and
|
|
* must flip with the theme or their bars vanish against the matching background.
|
|
*/
|
|
export function useProviderColors(): Record<UsageProviderKind, string> {
|
|
const { themeAppearance: scheme } = useAppearancePreferences();
|
|
return {
|
|
claude: "#d97757",
|
|
codex: scheme === "dark" ? "#e6e6e6" : "#3c3c43",
|
|
grok: scheme === "dark" ? "#a1a1aa" : "#52525b",
|
|
};
|
|
}
|