import PropTypes from 'prop-types'; import { useState, useEffect } from 'react'; import axios from 'axios'; import { Link } from 'react-router-dom'; import { motion } from 'framer-motion'; import Animation_Diligent from './../assets/animation_diligent.webm'; const api_url = process.env.REACT_APP_API_URL; export default function BlogSection(props) { const [cntBlog, setCntBlog] = useState(''); const [isLoaded, setIsLoaded] = useState(''); useEffect(async () => { var vid = document.getElementById('animation'); vid.playbackRate = 2; axios .get(`${api_url}/api/blogpage?populate[0]=post.image`) .then(res => { setCntBlog(res.data.data.attributes); setIsLoaded(true); }) .catch(err => { console.log(err); setIsLoaded(false); }); }, []); if (!isLoaded) { return (
); } return (
{cntBlog.subheading}

{cntBlog.heading}

{/* Blog Posts Section */}
{cntBlog.post.map(post => (
Post's image

{post.heading}

{post.paragraph}

{post.date}
Read More
))}
); } BlogSection.propTypes = { bgColor: PropTypes.string, padding: PropTypes.string, };