MCPcopy
hub / github.com/codeaashu/claude-code / RateLimitMessage

Function RateLimitMessage

src/components/messages/RateLimitMessage.tsx:52–160  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

50 onOpenRateLimitOptions?: () => void;
51};
52export function RateLimitMessage(t0) {
53 const $ = _c(16);
54 const {
55 text,
56 onOpenRateLimitOptions
57 } = t0;
58 let t1;
59 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
60 t1 = getSubscriptionType();
61 $[0] = t1;
62 } else {
63 t1 = $[0];
64 }
65 const subscriptionType = t1;
66 let t2;
67 if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
68 t2 = getRateLimitTier();
69 $[1] = t2;
70 } else {
71 t2 = $[1];
72 }
73 const rateLimitTier = t2;
74 const isTeamOrEnterprise = subscriptionType === "team" || subscriptionType === "enterprise";
75 const isMax20x = rateLimitTier === "default_claude_max_20x";
76 let t3;
77 if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
78 t3 = shouldProcessMockLimits() || isClaudeAISubscriber();
79 $[2] = t3;
80 } else {
81 t3 = $[2];
82 }
83 const shouldShowUpsell = t3;
84 const canSeeRateLimitOptionsUpsell = shouldShowUpsell && !isMax20x;
85 const [hasOpenedInteractiveMenu, setHasOpenedInteractiveMenu] = useState(false);
86 const claudeAiLimits = useClaudeAiLimits();
87 const isCurrentlyRateLimited = claudeAiLimits.status === "rejected" && claudeAiLimits.resetsAt !== undefined && !claudeAiLimits.isUsingOverage;
88 const shouldAutoOpenRateLimitOptionsMenu = canSeeRateLimitOptionsUpsell && !hasOpenedInteractiveMenu && isCurrentlyRateLimited && onOpenRateLimitOptions;
89 let t4;
90 let t5;
91 if ($[3] !== onOpenRateLimitOptions || $[4] !== shouldAutoOpenRateLimitOptionsMenu) {
92 t4 = () => {
93 if (shouldAutoOpenRateLimitOptionsMenu) {
94 setHasOpenedInteractiveMenu(true);
95 onOpenRateLimitOptions();
96 }
97 };
98 t5 = [shouldAutoOpenRateLimitOptionsMenu, onOpenRateLimitOptions];
99 $[3] = onOpenRateLimitOptions;
100 $[4] = shouldAutoOpenRateLimitOptionsMenu;
101 $[5] = t4;
102 $[6] = t5;
103 } else {
104 t4 = $[5];
105 t5 = $[6];
106 }
107 useEffect(t4, t5);
108 let t6;
109 bb0: {

Callers

nothing calls this directly

Calls 7

getSubscriptionTypeFunction · 0.85
getRateLimitTierFunction · 0.85
shouldProcessMockLimitsFunction · 0.85
useClaudeAiLimitsFunction · 0.85
getUpsellMessageFunction · 0.85
hasClaudeAiBillingAccessFunction · 0.85
isClaudeAISubscriberFunction · 0.50

Tested by

no test coverage detected