MCPcopy Create free account
hub / github.com/codeaashu/claude-code / OverageCreditUpsell

Function OverageCreditUpsell

src/components/LogoV2/OverageCreditUpsell.tsx:85–144  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

83 twoLine?: boolean;
84};
85export function OverageCreditUpsell(t0) {
86 const $ = _c(8);
87 const {
88 maxWidth,
89 twoLine
90 } = t0;
91 let t1;
92 let t2;
93 if ($[0] !== maxWidth || $[1] !== twoLine) {
94 t2 = Symbol.for("react.early_return_sentinel");
95 bb0: {
96 const info = getCachedOverageCreditGrant();
97 if (!info) {
98 t2 = null;
99 break bb0;
100 }
101 const amount = formatGrantAmount(info);
102 if (!amount) {
103 t2 = null;
104 break bb0;
105 }
106 if (twoLine) {
107 const title = getFeedTitle(amount);
108 let t3;
109 if ($[4] !== maxWidth) {
110 t3 = maxWidth ? truncate(FEED_SUBTITLE, maxWidth) : FEED_SUBTITLE;
111 $[4] = maxWidth;
112 $[5] = t3;
113 } else {
114 t3 = $[5];
115 }
116 let t4;
117 if ($[6] !== t3) {
118 t4 = <Text dimColor={true}>{t3}</Text>;
119 $[6] = t3;
120 $[7] = t4;
121 } else {
122 t4 = $[7];
123 }
124 t2 = <><Text color="claude">{maxWidth ? truncate(title, maxWidth) : title}</Text>{t4}</>;
125 break bb0;
126 }
127 const text = getUsageText(amount);
128 const display = maxWidth ? truncate(text, maxWidth) : text;
129 const highlightLen = Math.min(getFeedTitle(amount).length, display.length);
130 t1 = <Text dimColor={true}><Text color="claude">{display.slice(0, highlightLen)}</Text>{display.slice(highlightLen)}</Text>;
131 }
132 $[0] = maxWidth;
133 $[1] = twoLine;
134 $[2] = t1;
135 $[3] = t2;
136 } else {
137 t1 = $[2];
138 t2 = $[3];
139 }
140 if (t2 !== Symbol.for("react.early_return_sentinel")) {
141 return t2;
142 }

Callers

nothing calls this directly

Calls 5

formatGrantAmountFunction · 0.85
getFeedTitleFunction · 0.85
getUsageTextFunction · 0.85
truncateFunction · 0.50

Tested by

no test coverage detected