import { Box } from "@mui/material"; import { getVideo } from "./helper"; import type { SxProps } from "@mui/material"; import useSWR from "swr"; import LoadingSkeleton from "../LoadingSkeleton"; import { ApologyPage } from "@/components/ViewPublicationPage/ApologyPage"; type VideoIframeProps = { videoUrl: string; containerSX?: SxProps; }; export default function QuizVideo({ videoUrl, containerSX }: VideoIframeProps) { const { data: videoData, error, isLoading } = useSWR(["video", videoUrl], (params) => getVideo(params[1])); return ( {isLoading ? ( ) : !videoData || error ? ( ) : videoData.sourceName === "custom" || videoData.sourceName === "yandex" ? ( ) : ( )} ); }