import {Box, Skeleton, Stack} from "@mui/material"; import {useEffect} from "react"; const ImageContent = (prop) => { useEffect(() => { const timer = setTimeout(() => { prop.setIsSkeleton(false); }, 1500); return () => clearTimeout(timer); }, [prop.isSkeleton]); const isPDF = prop.imageLink && prop.imageLink.attachment && prop.imageLink.attachment.endsWith('.pdf'); return ( <> {prop.isSkeleton && ( )} {isPDF ? ( ) : ( prop.imageLink && prop.imageLink.attachment && ( ) )} ) } export default ImageContent;