import { Show, createMemo } from "solid-js"; import type { ContextInfo } from "../types"; interface ContextIndicatorProps { contextInfo: ContextInfo | null; } export function ContextIndicator(props: ContextIndicatorProps) { const percentage = createMemo(() => props.contextInfo?.percentage ?? 0); // Color based on usage: blue < 60%, yellow 60-85%, orange > 85% // Using OKLCH for perceptually uniform lightness and chroma across hues const color = createMemo(() => percentage() < 60 ? 'oklch(0.7 0.12 250)' : percentage() < 85 ? 'oklch(0.7 0.12 90)' : 'oklch(0.7 0.12 30)' ); return (
{/* Background circle */} {/* Progress circle */} {percentage().toFixed(0)}%
); }