From ae237cfe1b9d1fcac884c41181a8bc1d8b0c4f3d Mon Sep 17 00:00:00 2001
From: ghzhost
Date: Fri, 21 Aug 2026 15:09:07 +0000
Subject: [PATCH] fix(milestones): render EmptyState when milestones or pools
list is empty (#273)
---
src/app/milestones/page.tsx | 116 +++++++++++++++++++++---------------
1 file changed, 69 insertions(+), 47 deletions(-)
diff --git a/src/app/milestones/page.tsx b/src/app/milestones/page.tsx
index 16cf0af..680b352 100644
--- a/src/app/milestones/page.tsx
+++ b/src/app/milestones/page.tsx
@@ -1,6 +1,8 @@
+import { Layers } from "lucide-react";
import { fetchMilestones, fetchMaintenancePools } from "@/lib/api";
import { mockMilestones, mockMaintenancePools } from "@/lib/mock-data";
import { formatCurrency, formatPercent } from "@/lib/utils";
+import { EmptyState } from "@/components/ui/EmptyState";
import { MilestoneFundButton, PoolDepositButton } from "./MilestoneActions";
export const metadata = {
@@ -25,37 +27,47 @@ export default async function MilestonesPage() {
each one resolves.
-
- {milestones.map((m) => {
- const pct = m.distributed / m.budget;
- return (
-
-
{m.repo}
-
{m.name}
-
-
+ {milestones.length > 0 ? (
+
+ {milestones.map((m) => {
+ const pct = m.distributed / m.budget;
+ return (
+
+
{m.repo}
+
{m.name}
+
+
+
+ {formatCurrency(m.distributed, m.asset)} of{" "}
+ {formatCurrency(m.budget, m.asset)}
+
+ {formatPercent(pct)}
+
+
+ {m.completedCount} of {m.issueCount} issues complete
+
+
-
-
- {formatCurrency(m.distributed, m.asset)} of{" "}
- {formatCurrency(m.budget, m.asset)}
-
- {formatPercent(pct)}
-
-
- {m.completedCount} of {m.issueCount} issues complete
-
-
-
- );
- })}
-
+ );
+ })}
+
+ ) : (
+
+
+
+ )}
Recurring maintenance pools
@@ -64,23 +76,33 @@ export default async function MilestonesPage() {
Sponsors deposit monthly so maintainers can reward ongoing upkeep, like
dependency bumps, docs, and cleanup, that would otherwise go unfunded.
-
- {pools.map((pool) => (
-
-
{pool.repo}
-
- {formatCurrency(pool.balance, pool.asset)} balance
-
-
- {formatCurrency(pool.monthlyDeposit, pool.asset)} deposited monthly
-
-
-
- ))}
-
+ {pools.length > 0 ? (
+
+ {pools.map((pool) => (
+
+
{pool.repo}
+
+ {formatCurrency(pool.balance, pool.asset)} balance
+
+
+ {formatCurrency(pool.monthlyDeposit, pool.asset)} deposited monthly
+
+
+
+ ))}
+
+ ) : (
+
+
+
+ )}
);
}