From 3c6b8e97be4a2b4c793ddfcc5009fc1e0f00b9bb Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 30 Nov 2025 15:46:31 +0000
Subject: feat: add a notification badge for list invitations

---
 .../sidebar/InvitationNotificationBadge.tsx        | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx

(limited to 'apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx')

diff --git a/apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx b/apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx
new file mode 100644
index 00000000..e4d7b39f
--- /dev/null
+++ b/apps/web/components/dashboard/sidebar/InvitationNotificationBadge.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import { api } from "@/lib/trpc";
+
+export function InvitationNotificationBadge() {
+  const { data: pendingInvitations } = api.lists.getPendingInvitations.useQuery(
+    undefined,
+    {
+      refetchInterval: 1000 * 60 * 5,
+    },
+  );
+  const pendingInvitationsCount = pendingInvitations?.length ?? 0;
+
+  if (pendingInvitationsCount === 0) {
+    return null;
+  }
+
+  return (
+    <div className="flex items-center px-1">
+      <span className="rounded-full bg-blue-500 px-2 py-0.5 text-center text-xs text-white">
+        {pendingInvitationsCount}
+      </span>
+    </div>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

