MCPcopy Index your code
hub / github.com/codeaashu/claude-code / ExtraUsageSection

Function ExtraUsageSection

src/components/Settings/Usage.tsx:271–376  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

269};
270const EXTRA_USAGE_SECTION_TITLE = 'Extra usage';
271function ExtraUsageSection(t0) {
272 const $ = _c(20);
273 const {
274 extraUsage,
275 maxWidth
276 } = t0;
277 const subscriptionType = getSubscriptionType();
278 const isProOrMax = subscriptionType === "pro" || subscriptionType === "max";
279 if (!isProOrMax) {
280 return false;
281 }
282 if (!extraUsage.is_enabled) {
283 if (extraUsageCommand.isEnabled()) {
284 let t1;
285 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
286 t1 = <Box flexDirection="column"><Text bold={true}>{EXTRA_USAGE_SECTION_TITLE}</Text><Text dimColor={true}>Extra usage not enabled · /extra-usage to enable</Text></Box>;
287 $[0] = t1;
288 } else {
289 t1 = $[0];
290 }
291 return t1;
292 }
293 return null;
294 }
295 if (extraUsage.monthly_limit === null) {
296 let t1;
297 if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
298 t1 = <Box flexDirection="column"><Text bold={true}>{EXTRA_USAGE_SECTION_TITLE}</Text><Text dimColor={true}>Unlimited</Text></Box>;
299 $[1] = t1;
300 } else {
301 t1 = $[1];
302 }
303 return t1;
304 }
305 if (typeof extraUsage.used_credits !== "number" || typeof extraUsage.utilization !== "number") {
306 return null;
307 }
308 const t1 = extraUsage.used_credits / 100;
309 let t2;
310 if ($[2] !== t1) {
311 t2 = formatCost(t1, 2);
312 $[2] = t1;
313 $[3] = t2;
314 } else {
315 t2 = $[3];
316 }
317 const formattedUsedCredits = t2;
318 const t3 = extraUsage.monthly_limit / 100;
319 let t4;
320 if ($[4] !== t3) {
321 t4 = formatCost(t3, 2);
322 $[4] = t3;
323 $[5] = t4;
324 } else {
325 t4 = $[5];
326 }
327 const formattedMonthlyLimit = t4;
328 let T0;

Callers

nothing calls this directly

Calls 2

getSubscriptionTypeFunction · 0.85
formatCostFunction · 0.85

Tested by

no test coverage detected