Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

⚡️(frontend) add component to render children only for Admin or User

lebaudantoine33ac849d3bc9
diff --git a/src/frontend/src/features/rooms/components/AdminOrOwnerOnly.tsx b/src/frontend/src/features/rooms/components/AdminOrOwnerOnly.tsx
new file mode 100644
index 00000000..c6f750a0
--- /dev/null
+++ b/src/frontend/src/features/rooms/components/AdminOrOwnerOnly.tsx
@@ -0,0 +1,11 @@
+import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
+
+export const AdminOrOwnerOnly = ({
+ children,
+}: {
+ children: React.ReactNode
+}) => {
+ const isAdminOrOwner = useIsAdminOrOwner()
+ if (!isAdminOrOwner) return null
+ return children
+}