11"use client" ;
22
33import type { GetBillingPortalUrlAction } from "@/actions/billing" ;
4- import { BillingPortalButton } from "@/components/billing" ;
54import { Spinner } from "@/components/ui/Spinner/Spinner" ;
5+ import { Button } from "@/components/ui/button" ;
66import { useDashboardRouter } from "@/lib/DashboardRouter" ;
77import { cn } from "@/lib/utils" ;
8+ import Link from "next/link" ;
89import { useTransition } from "react" ;
910import { useStripeRedirectEvent } from "../../../../stripe-redirect/stripeRedirectChannel" ;
1011
@@ -14,7 +15,6 @@ function BillingAlertBanner(props: {
1415 teamSlug : string ;
1516 variant : "error" | "warning" ;
1617 ctaLabel : string ;
17- getBillingPortalUrl : GetBillingPortalUrlAction ;
1818} ) {
1919 const router = useDashboardRouter ( ) ;
2020 const [ isPending , startTransition ] = useTransition ( ) ;
@@ -44,22 +44,21 @@ function BillingAlertBanner(props: {
4444
4545 < h3 className = "font-semibold text-xl tracking-tight" > { props . title } </ h3 >
4646 < p className = "mt-1 mb-4 text-sm" > { props . description } </ p >
47- < BillingPortalButton
48- buttonProps = { {
49- size : "sm" ,
50- className : cn (
51- "gap-2" ,
52- props . variant === "warning" &&
53- "border border-yellow-600 bg-yellow-100 text-yellow-800 hover:bg-yellow-200 dark:border-yellow-700 dark:bg-yellow-900 dark:text-yellow-100 dark:hover:bg-yellow-800" ,
54- props . variant === "error" &&
55- "border border-red-600 bg-red-100 text-red-800 hover:bg-red-200 dark:border-red-700 dark:bg-red-900 dark:text-red-100 dark:hover:bg-red-800" ,
56- ) ,
57- } }
58- teamSlug = { props . teamSlug }
59- getBillingPortalUrl = { props . getBillingPortalUrl }
47+
48+ < Button
49+ asChild
50+ className = { cn (
51+ "gap-2" ,
52+ props . variant === "warning" &&
53+ "border border-yellow-600 bg-yellow-100 text-yellow-800 hover:bg-yellow-200 dark:border-yellow-700 dark:bg-yellow-900 dark:text-yellow-100 dark:hover:bg-yellow-800" ,
54+ props . variant === "error" &&
55+ "border border-red-600 bg-red-100 text-red-800 hover:bg-red-200 dark:border-red-700 dark:bg-red-900 dark:text-red-100 dark:hover:bg-red-800" ,
56+ ) }
6057 >
61- { props . ctaLabel }
62- </ BillingPortalButton >
58+ < Link href = { `/team/${ props . teamSlug } /~/settings/invoices` } >
59+ { props . ctaLabel }
60+ </ Link >
61+ </ Button >
6362 </ div >
6463 ) ;
6564}
@@ -73,7 +72,6 @@ export function PastDueBannerUI(props: {
7372 ctaLabel = "View Invoices"
7473 variant = "warning"
7574 title = "Unpaid Invoices"
76- getBillingPortalUrl = { props . getBillingPortalUrl }
7775 description = {
7876 < >
7977 You have unpaid invoices. Service may be suspended if not paid
@@ -94,7 +92,6 @@ export function ServiceCutOffBannerUI(props: {
9492 ctaLabel = "Pay Now"
9593 variant = "error"
9694 title = "Service Suspended"
97- getBillingPortalUrl = { props . getBillingPortalUrl }
9895 description = {
9996 < >
10097 Your service has been suspended due to unpaid invoices. Pay now to
0 commit comments