Files
qwen-code/packages/cli/src/ui/components/ContextUsageDisplay.tsx
Miguel Solorio 3c0af3654a Update semantic color tokens (#6253)
Co-authored-by: jacob314 <jacob314@gmail.com>
2025-08-15 22:39:54 +00:00

26 lines
535 B
TypeScript

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Text } from 'ink';
import { theme } from '../semantic-colors.js';
import { tokenLimit } from '@google/gemini-cli-core';
export const ContextUsageDisplay = ({
promptTokenCount,
model,
}: {
promptTokenCount: number;
model: string;
}) => {
const percentage = promptTokenCount / tokenLimit(model);
return (
<Text color={theme.text.secondary}>
({((1 - percentage) * 100).toFixed(0)}% context left)
</Text>
);
};