diff --git a/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx b/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx index d309cf166..b548ef777 100644 --- a/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx +++ b/apps/remix/app/routes/_authenticated+/o.$orgUrl.settings.billing.tsx @@ -3,7 +3,7 @@ import { Trans } from '@lingui/react/macro'; import { SubscriptionStatus } from '@prisma/client'; import { Loader } from 'lucide-react'; import type Stripe from 'stripe'; -import { match } from 'ts-pattern'; +import { P, match } from 'ts-pattern'; import { useCurrentOrganisation } from '@documenso/lib/client-only/providers/organisation'; import { canExecuteOrganisationAction } from '@documenso/lib/utils/organisations'; @@ -31,7 +31,7 @@ export default function TeamsSettingBillingPage() { if (isLoadingSubscription || !subscriptionQuery) { return (
- {currentProductName ? (
-
- You are currently subscribed to{' '}
- {currentProductName}
-
- ) : (
- You currently have an active plan
- )}
-
- {organisationSubscription.periodEnd && (
-
- {' '}
- which is set to{' '}
- {organisationSubscription.cancelAtPeriodEnd ? (
-
- end on{' '}
-
- {i18n.date(organisationSubscription.periodEnd)}.
-
-
+ {match(organisationSubscription)
+ .with(
+ { cancelAtPeriodEnd: true, periodEnd: P.nonNullable },
+ ({ periodEnd }) =>
+ currentProductName ? (
+