+
+
+ Plan usage
+
+
+ {isLoadingUsage
+ ? "…"
+ : `${planUsagePct < 1 && planUsagePct > 0 ? "< 1" : Math.round(planUsagePct)}% used`}
+
+
+
+
80
+ ? "#ef4444"
+ : hasPaidPlan
+ ? "linear-gradient(to right, #4BA0FA 80%, #002757 100%)"
+ : "#0054AD",
+ }}
+ title={`${formatUsageNumber(tokensUsed)} tokens · ${formatUsageNumber(searchesUsed)} queries`}
+ />
+
+ {!isLoadingUsage && (
+
+ {formatUsageNumber(tokensUsed)} tokens ·{" "}
+ {formatUsageNumber(searchesUsed)} queries
+
+ )}
)}
@@ -544,53 +571,6 @@ export function AddDocument({
)
}
-function UsageMeter({
- label,
- value,
- percent,
- active,
-}: {
- label: string
- value: string
- percent: number
- active: boolean
-}) {
- const safePercent = Math.max(0, Math.min(100, percent))
-
- return (
-
-
-
- {label}
-
-
- {value}
-
-
-
-
80
- ? "#ef4444"
- : active
- ? "linear-gradient(to right, #4BA0FA 80%, #002757 100%)"
- : "#0054AD",
- }}
- />
-
-
- )
-}
-
function TabButton({
active,
onClick,