import { useEffect, useState } from "react"; import EmbedSnippet from "@calcom/embed-snippet"; export default function useEmbed(embedJsUrl?: string) { const [globalCal, setGlobalCal] = useState>(); useEffect(() => { setGlobalCal(() => { return EmbedSnippet(embedJsUrl); }); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return globalCal; }