fix: simply billing

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-05 09:03:03 +01:00
parent bbd30ca6e0
commit d9e3883d11
53 changed files with 1543 additions and 1240 deletions

View File

@@ -2,7 +2,6 @@ import FullPageLoadingState from '@/components/full-page-loading-state';
import { LinkButton } from '@/components/ui/button';
import { useTRPC } from '@/integrations/trpc/react';
import { cn } from '@/utils/cn';
import { FREE_PRODUCT_IDS } from '@openpanel/payments';
import { useSuspenseQuery } from '@tanstack/react-query';
import {
Outlet,
@@ -106,24 +105,9 @@ function Component() {
</LinkButton>
</Alert>
)}
{organization.subscriptionEndsAt && organization.isExpired && (
<Alert
title="Subscription expired"
description={`Your subscription has expired. You can reactivate it by choosing a new plan below. It expired on ${format(organization.subscriptionEndsAt, 'PPP')}`}
>
<LinkButton
to="/$organizationId/billing"
params={{
organizationId: organizationId,
}}
>
Reactivate
</LinkButton>
</Alert>
)}
{organization.subscriptionEndsAt && organization.isWillBeCanceled && (
<Alert
title="Subscription will becanceled"
title="Subscription will be canceled"
description={`You have canceled your subscription. You can reactivate it by choosing a new plan below. It'll expire on ${format(organization.subscriptionEndsAt, 'PPP')}`}
>
<LinkButton
@@ -151,24 +135,6 @@ function Component() {
</LinkButton>
</Alert>
)}
{organization.subscriptionProductId &&
FREE_PRODUCT_IDS.includes(organization.subscriptionProductId) && (
<Alert
title="Free plan is removed"
description="We've removed the free plan. You can upgrade to a paid plan to continue using OpenPanel."
className="bg-orange-400/40 border-orange-400/50"
>
<LinkButton
className="bg-orange-400 text-white hover:bg-orange-400/80"
to="/$organizationId/billing"
params={{
organizationId: organizationId,
}}
>
Upgrade
</LinkButton>
</Alert>
)}
<Outlet />
</>
);