import React from "react"; import { useLoadGroupCall } from "./useLoadGroupCall"; import { ErrorView, FullScreenView } from "../FullScreenView"; import { usePageTitle } from "../usePageTitle"; export function GroupCallLoader({ client, roomId, viaServers, children }) { const { loading, error, groupCall } = useLoadGroupCall( client, roomId, viaServers, true ); usePageTitle(groupCall ? groupCall.room.name : "Loading..."); if (loading) { return (

Loading room...

); } if (error) { return ; } return children(groupCall); }