diff --git a/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/components/billing-history.tsx b/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/components/billing-history.tsx
index 46db86820d2..ecade336024 100644
--- a/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/components/billing-history.tsx
+++ b/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/components/billing-history.tsx
@@ -6,6 +6,7 @@ import {
Table,
TableBody,
TableCell,
+ TableContainer,
TableHead,
TableHeader,
TableRow,
@@ -26,7 +27,6 @@ export function BillingHistory(props: {
invoices: Stripe.Invoice[];
hasMore: boolean;
}) {
- console.log(props.invoices.map((i) => i.id));
const [isLoading, startTransition] = useTransition();
const [cursor, setCursor] = useQueryState(
"cursor",
@@ -55,24 +55,13 @@ export function BillingHistory(props: {
const getStatusBadge = (invoice: Stripe.Invoice) => {
switch (invoice.status) {
case "paid":
- return (
-
- Paid
-
- );
+ return Paid;
case "open":
// we treate "uncollectible" as unpaid
case "uncollectible": {
// if the invoice due date is in the past, we want to display it as past due
if (invoice.due_date && invoice.due_date < Date.now()) {
- return (
-
- Past Due
-
- );
+ return Past Due;
}
return Open;
}
@@ -96,9 +85,11 @@ export function BillingHistory(props: {
);
}
+ const showPagination = props.hasMore || cursor;
+
return (
-
+
@@ -130,7 +121,7 @@ export function BillingHistory(props: {
target="_blank"
rel="noopener noreferrer"
>
-
+
Pay Now
@@ -143,7 +134,7 @@ export function BillingHistory(props: {
target="_blank"
rel="noopener noreferrer"
>
-
+
PDF
@@ -154,47 +145,47 @@ export function BillingHistory(props: {
))}
-
+
- {/* Pagination Controls */}
-
-
-
-
-
+ {showPagination && (
+
+
+
+
+ )}
);
}
diff --git a/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/page.tsx b/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/page.tsx
index 11d39b9b289..9e7621817b7 100644
--- a/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/page.tsx
+++ b/apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/invoices/page.tsx
@@ -1,12 +1,5 @@
import { getTeamInvoices } from "@/actions/stripe-actions";
import { getTeamBySlug } from "@/api/team";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
import { redirect } from "next/navigation";
import type { SearchParams } from "nuqs/server";
import { getValidAccount } from "../../../../../../account/settings/getAccount";
@@ -41,16 +34,16 @@ export default async function Page(props: {
});
return (
-
-
- Invoice History
-
+
+
+
+ Invoice History
+
+
View your past invoices and payment history
-
-
-
-
-
-
+
+
+
+
);
}