File tree Expand file tree Collapse file tree
apps/webapp/app/components/billing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,25 +147,26 @@ function NoLimitConfiguredBanner({ onBillingLimitsPage }: { onBillingLimitsPage:
147147 const organization = useOrganization ( ) ;
148148 const canManageBillingLimits = useCanManageBillingLimits ( ) ;
149149
150- const message = canManageBillingLimits
151- ? onBillingLimitsPage
152- ? "Please configure a billing limit to protect your organization from unexpected usage spikes."
153- : "Protect your organization from unexpected usage spikes."
154- : "Billing limits are not configured for this organization. Contact an organization administrator to configure them." ;
150+ // Users who can't manage billing limits can't act on this — no banner for them.
151+ if ( ! canManageBillingLimits ) {
152+ return null ;
153+ }
155154
156155 return (
157156 < AnimatedOrgBannerBar
158157 show
159158 variant = "warning"
160159 action = {
161- canManageBillingLimits && ! onBillingLimitsPage ? (
160+ onBillingLimitsPage ? undefined : (
162161 < LinkButton variant = "tertiary/small" to = { v3BillingLimitsPath ( organization ) } >
163162 Configure billing limit
164163 </ LinkButton >
165- ) : undefined
164+ )
166165 }
167166 >
168- { message }
167+ { onBillingLimitsPage
168+ ? "Please configure a billing limit to protect your organization from unexpected usage spikes."
169+ : "Protect your organization from unexpected usage spikes." }
169170 </ AnimatedOrgBannerBar >
170171 ) ;
171172}
You can’t perform that action at this time.
0 commit comments