'use client'; import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { cn } from '@/lib/utils'; import type { ComponentProps } from 'react'; import { Separator } from '@/components/ui/separator'; import { Progress } from '@/components/ui/progress'; import type { AppUsage } from '@/lib/usage'; export type ContextProps = ComponentProps<'button'> & { /** Optional full usage payload to enable breakdown view */ usage?: AppUsage; }; const THOUSAND = 1000; const MILLION = 1_000_000; const BILLION = 1_000_000_000; const PERCENT_MAX = 100; // Lucide CircleIcon geometry const ICON_VIEWBOX = 24; const ICON_CENTER = 12; const ICON_RADIUS = 10; const ICON_STROKE_WIDTH = 2; type ContextIconProps = { percent: number; // 0 - 100 }; export const ContextIcon = ({ percent }: ContextIconProps) => { const radius = ICON_RADIUS; const circumference = 2 * Math.PI * radius; const dashOffset = circumference * (1 - percent / PERCENT_MAX); return ( ); }; function InfoRow({ label, tokens, costText, }: { label: string; tokens?: number; costText?: string; }) { return (