mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 12:49:06 +00:00
16 lines
404 B
TypeScript
16 lines
404 B
TypeScript
import { useEffect, useState } from "react";
|
|
|
|
export const useWhereby = () => {
|
|
const [wherebyLoaded, setWherebyLoaded] = useState(false);
|
|
useEffect(() => {
|
|
if (typeof window !== "undefined") {
|
|
import("@whereby.com/browser-sdk/embed")
|
|
.then(() => {
|
|
setWherebyLoaded(true);
|
|
})
|
|
.catch(console.error.bind(console));
|
|
}
|
|
}, []);
|
|
return wherebyLoaded;
|
|
};
|