diff --git a/src/admin/AdminNav.tsx b/src/admin/AdminNav.tsx
index aa1110da..ceef18c9 100644
--- a/src/admin/AdminNav.tsx
+++ b/src/admin/AdminNav.tsx
@@ -31,6 +31,8 @@ export default async function AdminNav() {
getPhotosMostRecentUpdateCached().catch(() => undefined),
]);
+ const includeInsights = countPhotos > 0;
+
// Photos
const items = [{
label: 'Photos',
@@ -53,6 +55,10 @@ export default async function AdminNav() {
}); }
return (
-
+
);
}
diff --git a/src/admin/AdminNavClient.tsx b/src/admin/AdminNavClient.tsx
index c90063c6..b112dc3e 100644
--- a/src/admin/AdminNavClient.tsx
+++ b/src/admin/AdminNavClient.tsx
@@ -29,6 +29,7 @@ const areTimesRecent = (dates: Date[]) => dates
export default function AdminNavClient({
items,
mostRecentPhotoUpdateTime,
+ includeInsights,
}: {
items: {
label: string,
@@ -36,6 +37,7 @@ export default function AdminNavClient({
count: number,
}[]
mostRecentPhotoUpdateTime?: Date
+ includeInsights?: boolean
}) {
const pathname = usePathname();
@@ -90,17 +92,18 @@ export default function AdminNavClient({
)}
-
}
- >
-
-
+ {includeInsights &&
+
}
+ >
+
+ }