11"use client" ;
22
3- import { useState } from "react" ;
4- import { Badge } from "@/components/ui/badge" ;
5- import { Progress } from "@/components/ui/progress" ;
6- import { Button } from "@/components/ui/button" ;
7- import { Card , CardContent , CardDescription , CardHeader , CardTitle } from "@/components/ui/card" ;
3+ import { Badge } from "@/components/ui/badge" ;
4+ import { Progress } from "@/components/ui/progress" ;
5+ import { Button } from "@/components/ui/button" ;
6+ import { Card , CardContent , CardDescription , CardHeader , CardTitle } from "@/components/ui/card" ;
87import { Tables } from "@/utils/supabase/database.types" ;
98import { PLANS } from "@/utils/constants" ;
109import { format } from "date-fns" ;
11- import { pro_monthly_id , pro_yearly_id , usePaddle } from "@/hooks/usePaddle" ;
10+ import { pro_monthly_id , usePaddle } from "@/hooks/usePaddle" ;
1211
1312type Props = {
1413 subscription : ( Tables < 'subscriptions' > & Tables < 'customers' > ) | null ;
@@ -18,8 +17,8 @@ type Props = {
1817 }
1918}
2019
21- export default function SubscriptionCard ( { subscription, usages, customerData } : Props ) {
22- const { paddle, error , handleUpgrade} = usePaddle ( ) ;
20+ export default function SubscriptionCard ( { subscription, usages, customerData} : Props ) {
21+ const { paddle, handleUpgrade} = usePaddle ( ) ;
2322
2423 const isPro = subscription ?. subscription_status === "active" ;
2524 const maxRequestsPerMonth = isPro ? PLANS . PRO . REQUESTS_PER_MONTH : PLANS . BASIC . REQUESTS_PER_MONTH
@@ -30,7 +29,7 @@ export default function SubscriptionCard({ subscription, usages, customerData }:
3029 const handleCancel = async ( ) => {
3130 try {
3231 paddle ?. Retain . initCancellationFlow ( {
33- subscriptionId : subscription ?. subscription_id ! ,
32+ subscriptionId : subscription ?. subscription_id as string ,
3433 } )
3534 } catch ( error ) {
3635 console . error ( "Error canceling subscription:" , error ) ;
@@ -74,7 +73,7 @@ export default function SubscriptionCard({ subscription, usages, customerData }:
7473 { usages } / { maxRequestsPerMonth }
7574 </ div >
7675 </ div >
77- < Progress value = { usagePercentage } className = "h-2" />
76+ < Progress value = { usagePercentage } className = "h-2" />
7877 </ CardContent >
7978 </ Card >
8079 ) ;
0 commit comments