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

Function getUpsellMessage

src/components/messages/RateLimitMessage.tsx:18–47  ·  view source on GitHub ↗
({
  shouldShowUpsell,
  isMax20x,
  isExtraUsageCommandEnabled,
  shouldAutoOpenRateLimitOptionsMenu,
  isTeamOrEnterprise,
  hasBillingAccess
}: UpsellParams)

Source from the content-addressed store, hash-verified

16 hasBillingAccess: boolean;
17};
18export function getUpsellMessage({
19 shouldShowUpsell,
20 isMax20x,
21 isExtraUsageCommandEnabled,
22 shouldAutoOpenRateLimitOptionsMenu,
23 isTeamOrEnterprise,
24 hasBillingAccess
25}: UpsellParams): string | null {
26 if (!shouldShowUpsell) return null;
27 if (isMax20x) {
28 if (isExtraUsageCommandEnabled) {
29 return '/extra-usage to finish what you\u2019re working on.';
30 }
31 return '/login to switch to an API usage-billed account.';
32 }
33 if (shouldAutoOpenRateLimitOptionsMenu) {
34 return 'Opening your options\u2026';
35 }
36 if (!isTeamOrEnterprise && !isExtraUsageCommandEnabled) {
37 return '/upgrade to increase your usage limit.';
38 }
39 if (isTeamOrEnterprise) {
40 if (!isExtraUsageCommandEnabled) return null;
41 if (hasBillingAccess) {
42 return '/extra-usage to finish what you\u2019re working on.';
43 }
44 return '/extra-usage to request more usage from your admin.';
45 }
46 return '/upgrade or /extra-usage to finish what you\u2019re working on.';
47}
48type RateLimitMessageProps = {
49 text: string;
50 onOpenRateLimitOptions?: () => void;

Callers 1

RateLimitMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected