Skip to content

Commit dc5dde8

Browse files
committed
even more cleanup
1 parent 6ad6f1a commit dc5dde8

File tree

3 files changed

+15
-36
lines changed

3 files changed

+15
-36
lines changed

apps/dashboard/app/(main)/billing/components/billing-header.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { CreditCardIcon } from "@phosphor-icons/react";
44
import { usePathname } from "next/navigation";
55

6-
const PAGE_TITLES = {
6+
const PAGE_TITLES: Record<string, { title: string; description: string }> = {
77
"/billing": {
88
title: "Usage & Metrics",
99
description: "Monitor your usage and billing metrics",
@@ -25,12 +25,11 @@ const DEFAULT_TITLE = {
2525

2626
export function BillingHeader() {
2727
const pathname = usePathname();
28-
const { title, description } =
29-
PAGE_TITLES[pathname as keyof typeof PAGE_TITLES] ?? DEFAULT_TITLE;
28+
const { title, description } = PAGE_TITLES[pathname] ?? DEFAULT_TITLE;
3029

3130
return (
3231
<div className="border-b bg-linear-to-r from-background via-background to-muted/20">
33-
<div className="flex flex-col justify-between gap-3 p-4 sm:flex-row sm:items-center sm:gap-0 sm:px-6 sm:py-6">
32+
<div className="flex h-24 items-center px-4 sm:px-6">
3433
<div className="min-w-0 flex-1">
3534
<div className="flex items-center gap-4">
3635
<div className="rounded-xl border border-primary/20 bg-primary/10 p-3">

apps/dashboard/app/(main)/billing/history/page.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,11 @@ function SubscriptionItem({ product }: { product: ProductStatus }) {
200200
<div
201201
className={cn(
202202
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
203-
isActive ? "bg-emerald-500/10" : "bg-muted"
203+
isActive ? "bg-primary/10" : "bg-muted"
204204
)}
205205
>
206206
{isActive ? (
207-
<CheckCircleIcon
208-
className="text-emerald-500"
209-
size={14}
210-
weight="fill"
211-
/>
207+
<CheckCircleIcon className="text-primary" size={14} weight="fill" />
212208
) : (
213209
<ClockIcon className="text-muted-foreground" size={14} />
214210
)}
@@ -219,10 +215,7 @@ function SubscriptionItem({ product }: { product: ProductStatus }) {
219215
{product.name || product.id}
220216
</span>
221217
{isActive && (
222-
<Badge
223-
className="bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"
224-
variant="secondary"
225-
>
218+
<Badge className="bg-primary/10 text-primary" variant="secondary">
226219
Active
227220
</Badge>
228221
)}
@@ -296,13 +289,15 @@ function BillingSummary({ invoices }: { invoices: CustomerInvoice[] }) {
296289
function EmptyInvoices() {
297290
return (
298291
<div className="flex flex-col items-center justify-center py-16 text-center">
299-
<ReceiptIcon
300-
className="mb-3 text-muted-foreground"
301-
size={32}
302-
weight="duotone"
303-
/>
304-
<p className="font-medium">No invoices yet</p>
305-
<p className="text-muted-foreground text-sm">
292+
<div className="mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-muted">
293+
<ReceiptIcon
294+
className="text-muted-foreground"
295+
size={24}
296+
weight="duotone"
297+
/>
298+
</div>
299+
<p className="font-semibold">No invoices yet</p>
300+
<p className="mt-1 max-w-xs text-muted-foreground text-sm">
306301
Invoices will appear here after your first payment
307302
</p>
308303
</div>

apps/dashboard/app/(main)/billing/types/billing.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,3 @@ export type PaymentMethod = {
3030
export type CustomerWithPaymentMethod = AutumnCustomer & {
3131
payment_method?: PaymentMethod;
3232
};
33-
34-
export type InvoiceStatus =
35-
| "paid"
36-
| "open"
37-
| "pending"
38-
| "failed"
39-
| "draft"
40-
| "void";
41-
42-
export type InvoiceStatusConfig = {
43-
variant: "default" | "secondary" | "destructive" | "outline";
44-
className: string;
45-
text: string;
46-
};
47-

0 commit comments

Comments
 (0)