26 lines
458 B
TypeScript
Raw Normal View History

2024-05-03 13:53:21 -07:00
"use client"
import { RoomProvider } from "@/liveblocks.config"
import { ClientSideSuspense } from "@liveblocks/react"
2024-05-03 14:27:45 -07:00
export function Room({
id,
children,
}: {
id: string
children: React.ReactNode
}) {
2024-05-03 13:53:21 -07:00
return (
<RoomProvider
2024-05-03 14:27:45 -07:00
id={id}
2024-05-03 13:53:21 -07:00
initialPresence={{
cursor: null,
}}
>
<ClientSideSuspense fallback={<div>Loading!!!!</div>}>
{() => children}
</ClientSideSuspense>
</RoomProvider>
)
}