+
Summary
+
+ Top-up amount:
+ {formatUsd(Number(selectedAmount))}
+
+
+ New balance:
+
+ {formatUsd(currentBalance + Number(selectedAmount))}
+
+
+
+ );
+}
+
+function TopUpSummarySkeleton({
+ selectedAmount,
+}: {
+ selectedAmount: string;
+}) {
+ return (
+
@@ -44,18 +46,44 @@ export default async function Page(props: {
);
}
+ const client = getClientThirdwebClient({
+ jwt: authToken,
+ teamId: team.id,
+ });
+
+ const highlightPlan =
+ typeof searchParams.highlight === "string"
+ ? (searchParams.highlight as Team["billingPlan"])
+ : undefined;
+
+ const validPayment =
+ team.billingStatus === "validPayment" || team.billingStatus === "pastDue";
+
return (
-
+
+
+
+ {/* Credit Balance Section */}
+ {searchParams.showCreditBalance === "true" && team.stripeCustomerId && (
+
+ )}
+
+
+
+
);
}
diff --git a/apps/dashboard/src/components/settings/Account/Billing/index.tsx b/apps/dashboard/src/components/settings/Account/Billing/index.tsx
deleted file mode 100644
index d46d3717281..00000000000
--- a/apps/dashboard/src/components/settings/Account/Billing/index.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import type { Team } from "@/api/team";
-import type { TeamSubscription } from "@/api/team-subscription";
-import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
-import type { ThirdwebClient } from "thirdweb";
-import { PlanInfoCardClient } from "../../../../app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.client";
-import { CreditsInfoCard } from "./PlanCard";
-import { Coupons } from "./SubscriptionCoupons/Coupons";
-
-// TODO - move this in app router folder in other pr
-
-interface BillingProps {
- team: Team;
- subscriptions: TeamSubscription[];
- twAccount: Account;
- client: ThirdwebClient;
- openPlanSheetButtonByDefault: boolean;
- highlightPlan: Team["billingPlan"] | undefined;
-}
-
-export const Billing: React.FC
= ({
- team,
- subscriptions,
- twAccount,
- client,
- openPlanSheetButtonByDefault,
- highlightPlan,
-}) => {
- const validPayment =
- team.billingStatus === "validPayment" || team.billingStatus === "pastDue";
-
- return (
-
- );
-};