mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-31 21:11:44 +02:00
Improve the non paid user headings
This commit is contained in:
@@ -31,19 +31,22 @@ export function AICourseLimit(props: AICourseLimitProps) {
|
|||||||
|
|
||||||
const totalPercentage = getPercentage(used, limit);
|
const totalPercentage = getPercentage(used, limit);
|
||||||
|
|
||||||
// has consumed 80% of the limit
|
// has consumed 85% of the limit
|
||||||
const isNearLimit = used >= limit * 0.8;
|
const isNearLimit = used >= limit * 0.85;
|
||||||
const isPaidUser = userBillingDetails.status === 'active';
|
const isPaidUser = userBillingDetails.status === 'active';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button
|
{!isPaidUser ||
|
||||||
className="mr-1 flex items-center gap-1 text-sm font-medium underline underline-offset-2 lg:hidden"
|
(isNearLimit && (
|
||||||
onClick={() => onShowLimits()}
|
<button
|
||||||
>
|
className="mr-1 flex items-center gap-1 text-sm font-medium underline underline-offset-2 lg:hidden"
|
||||||
<Info className="size-4" />
|
onClick={() => onShowLimits()}
|
||||||
{totalPercentage}% limit used
|
>
|
||||||
</button>
|
<Info className="size-4" />
|
||||||
|
{totalPercentage}% limit used
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
|
||||||
{(!isPaidUser || isNearLimit) && (
|
{(!isPaidUser || isNearLimit) && (
|
||||||
<button
|
<button
|
||||||
|
Reference in New Issue
Block a user