import Frame from "react-frame-component"; import useHasMounted from "../../hooks/useHasMounted"; export type GistEmbedProps = { id: string; file?: string; }; const GistEmbed = ({ id, file }: GistEmbedProps) => { const hasMounted = useHasMounted(); const scriptUrl = `https://gist.github.com/${id}.js${file ? `?file=${file}` : ""}`; const iframeId = file ? `gist-${id}-${file}` : `gist-${id}`; // https://github.com/tleunen/react-gist/blob/master/src/index.js#L29 const iframeHtml = `