From 7a84480d7059c3968918c906e7338f1e86bd36f9 Mon Sep 17 00:00:00 2001
From: pascalyazid
Date: Mon, 28 Sep 2026 16:29:54 +0200
Subject: [PATCH] Added owners for each room
---
app/(auth)/rooms/[id]/page.tsx | 9 +++++++--
app/(auth)/rooms/[id]/room-settings.tsx | 24 ++++++++++++++----------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/app/(auth)/rooms/[id]/page.tsx b/app/(auth)/rooms/[id]/page.tsx
index 500bf73..049e588 100644
--- a/app/(auth)/rooms/[id]/page.tsx
+++ b/app/(auth)/rooms/[id]/page.tsx
@@ -31,7 +31,7 @@ export default async function RoomDetailPage({
const { data: room } = await supabase
.from("rooms")
- .select("id, name, created_at")
+ .select("id, name, created_at, owner_id")
.eq("id", id)
.single();
@@ -73,7 +73,12 @@ export default async function RoomDetailPage({
-
+
{/* Chat */}
diff --git a/app/(auth)/rooms/[id]/room-settings.tsx b/app/(auth)/rooms/[id]/room-settings.tsx
index 99460fe..84b739a 100644
--- a/app/(auth)/rooms/[id]/room-settings.tsx
+++ b/app/(auth)/rooms/[id]/room-settings.tsx
@@ -10,10 +10,12 @@ export function RoomSettings({
roomId,
members,
currentUserId,
+ ownerId,
}: Readonly<{
roomId: string;
members: MemberEntry[];
currentUserId: string;
+ ownerId: string;
}>) {
const [open, setOpen] = useState(false);
const [deleting, setDeleting] = useState(false);
@@ -89,16 +91,18 @@ export function RoomSettings({
/>
- {/* Danger zone */}
-
-
-
+ {/* Danger zone — only visible to the room owner */}
+ {currentUserId === ownerId && (
+
+
+
+ )}
>
)}