Improve the non paid user headings

refactor/ai-courses
Kamran Ahmed 2 months ago
parent f72d4ddc40
commit b74f290995
  1. 7
      src/components/GenerateCourse/AICourseLimit.tsx

@ -31,12 +31,14 @@ 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 (
<> <>
{!isPaidUser ||
(isNearLimit && (
<button <button
className="mr-1 flex items-center gap-1 text-sm font-medium underline underline-offset-2 lg:hidden" className="mr-1 flex items-center gap-1 text-sm font-medium underline underline-offset-2 lg:hidden"
onClick={() => onShowLimits()} onClick={() => onShowLimits()}
@ -44,6 +46,7 @@ export function AICourseLimit(props: AICourseLimitProps) {
<Info className="size-4" /> <Info className="size-4" />
{totalPercentage}% limit used {totalPercentage}% limit used
</button> </button>
))}
{(!isPaidUser || isNearLimit) && ( {(!isPaidUser || isNearLimit) && (
<button <button

Loading…
Cancel
Save