import { useSync } from '@tldraw/sync'
import { ReactNode, useEffect, useState } from 'react'
import { useParams } from 'react-router-dom'
import { Tldraw } from 'tldraw'
import { getBookmarkPreview } from '../getBookmarkPreview'
import { multiplayerAssetStore } from '../multiplayerAssetStore'
export function Room() {
const { roomId } = useParams<{ roomId: string }>()
// Create a store connected to multiplayer.
const store = useSync({
// We need to know the websockets URI...
uri: `${window.location.origin}/api/connect/${roomId}`,
// ...and how to handle static assets like images & videos
assets: multiplayerAssetStore,
})
return (