mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-04-03 18:24:12 +00:00
22 lines
556 B
TypeScript
22 lines
556 B
TypeScript
'use client';
|
|
|
|
import { ReactNode } from 'react';
|
|
import { RoomProvider } from '@/liveblocks.config';
|
|
import { ClientSideSuspense } from '@liveblocks/react';
|
|
import { useAuth } from '@clerk/nextjs';
|
|
|
|
const Room = ({ children }: { children: ReactNode }) => {
|
|
const { orgId } = useAuth();
|
|
|
|
if (!orgId) return null;
|
|
|
|
return (
|
|
<RoomProvider id={orgId} initialPresence={{ cursor: null }}>
|
|
<ClientSideSuspense fallback={<div>Loading…</div>}>
|
|
{() => children}
|
|
</ClientSideSuspense>
|
|
</RoomProvider>
|
|
);
|
|
}
|
|
|
|
export default Room;
|