26 lines
550 B
React
26 lines
550 B
React
|
import React from "react";
|
||
|
import { useLoadGroupCall } from "../ConferenceCallManagerHooks";
|
||
|
import { ErrorView, FullScreenView } from "../FullScreenView";
|
||
|
|
||
|
export function GroupCallLoader({ client, roomId, viaServers, children }) {
|
||
|
const { loading, error, groupCall } = useLoadGroupCall(
|
||
|
client,
|
||
|
roomId,
|
||
|
viaServers
|
||
|
);
|
||
|
|
||
|
if (loading) {
|
||
|
return (
|
||
|
<FullScreenView>
|
||
|
<h1>Loading room...</h1>
|
||
|
</FullScreenView>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
if (error) {
|
||
|
return <ErrorView error={error} />;
|
||
|
}
|
||
|
|
||
|
return children(groupCall);
|
||
|
}
|