import { jsxs as _jsxs } from "react/jsx-runtime";
/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { Text } from 'ink';
import { SemanticColors } from '../colors.js';
import { tokenLimit } from '@vybestack/llxprt-code-core';
export const ContextUsageDisplay = ({ promptTokenCount, model, contextLimit, }) => {
    const limit = tokenLimit(model, contextLimit);
    const percentage = promptTokenCount / limit;
    const remainingPercentage = (1 - percentage) * 100;
    // Use semantic colors based on how much context is left
    let color;
    if (remainingPercentage < 10) {
        color = SemanticColors.status.error; // Very low context
    }
    else if (remainingPercentage < 25) {
        color = SemanticColors.status.warning; // Low context
    }
    else {
        color = SemanticColors.text.secondary; // Normal context
    }
    return (_jsxs(Text, { color: color, children: ["(", remainingPercentage.toFixed(0), "% context left)"] }));
};
//# sourceMappingURL=ContextUsageDisplay.js.map