Skip to content

Commit 4eae8b0

Browse files
chore(web): Filter out -zsh invoices
1 parent 8600c88 commit 4eae8b0

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

packages/web/src/app/(app)/settings/license/recentInvoicesCard.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ import { SettingsCard, SettingsCardGroup } from "../components/settingsCard";
55
import { Badge } from "@/components/ui/badge";
66
import { Button } from "@/components/ui/button";
77
import { formatCurrency } from "@/lib/utils";
8+
import { useMemo } from "react";
89

910
interface RecentInvoicesCardProps {
1011
invoices: Invoice[];
1112
}
1213

13-
export function RecentInvoicesCard({ invoices }: RecentInvoicesCardProps) {
14+
export function RecentInvoicesCard({ invoices: _invoices }: RecentInvoicesCardProps) {
15+
16+
const invoices = useMemo(() => {
17+
return _invoices.filter(invoice => invoice.amount > 0);
18+
}, [_invoices]);
19+
20+
1421
if (invoices.length === 0) {
1522
return null;
1623
}
@@ -19,9 +26,11 @@ export function RecentInvoicesCard({ invoices }: RecentInvoicesCardProps) {
1926
<div className="flex flex-col gap-3">
2027
<p className="font-medium">Recent invoices</p>
2128
<SettingsCardGroup>
22-
{invoices.map((invoice) => (
23-
<InvoiceRow key={invoice.id} invoice={invoice} />
24-
))}
29+
{invoices
30+
.map((invoice) => (
31+
<InvoiceRow key={invoice.id} invoice={invoice} />
32+
))
33+
}
2534
</SettingsCardGroup>
2635
</div>
2736
);

0 commit comments

Comments
 (0)