import React, { useEffect, useRef, useState } from 'react'; import './Blog.scss'; import Navbar from '../../PozoApp/Components/Navbar'; import IndustriesList from '../../PozoApp/Components/IndustriesList'; import CompanyList from '../../PozoApp/Components/companyList'; import Lenis from "@studio-freight/lenis"; import Loader from '../../PozoApp/Components/Loader/PozoLoader'; import { RiInstagramFill, RiTwitterXFill } from 'react-icons/ri'; import { FaFacebook, FaYoutube } from 'react-icons/fa'; import { message } from 'antd'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import { getBlog, getPublishedBlogs } from '../../features/Blog/Blog'; import { getAllApplicationData } from '../../features/publicHome/publicHome'; import { getSeo } from '../../features/SEO/seo'; import { getConfigNames } from '../../features/configmasterPage/configmasterPage'; import SEO from '../../Components/SEO/SEO'; import { PiInstagramLogoFill } from 'react-icons/pi'; import BookDemo from '../../PozoApp/Components/BookDemo'; const subDirectory = import.meta.env.ENV_BASE_URL; const Blogs = () => { const [isScrolled, setIsScrolled] = useState(false); const [industries, setAppCategory] = useState([]); const [closingIndustry, setClosingIndustry] = useState(false); const [industry, setIndustry] = useState(false); const [company, setCompany] = useState(false); const companyRef = useRef(null); const industryRef = useRef(null); const [closingCompany, setClosingCompany] = useState(false); const [loading, setLoading] = useState(true); const [blogPosts, setBlogPosts] = useState([]); const [seoData, setSeoData] = useState({}); const dispatch = useDispatch(); const navigate = useNavigate(); const [demoModal, setDemoModal] = useState(false); const handleDemoModal = () => setDemoModal(true); const handleDemoModalClose = () => setDemoModal(false); const getAppData = async () => { try { const response = await dispatch(getAllApplicationData()).unwrap(); if (response?.data?.statusCode === 1) { let finalsubCategory = response?.data?.data?.filter( (value) => value.ActiveStatus === "A", ); setAppCategory(finalsubCategory); } } catch (error) { console.error('Error fetching app data:', error); } }; useEffect(() => { const timer = setTimeout(() => { setLoading(false); }, 300); getAppData(); return () => clearTimeout(timer); }, []); useEffect(() => { fetchBlogPosts(); }, []) useEffect(() => { const fetchSEOData = async () => { try { const res = await dispatch(getConfigNames({ TypeName: "SEO" })).unwrap(); if (res?.data?.statusCode === 1) { const seoId = res?.data?.data?.find(e => e.ConfigName === "blog")?.ConfigId; if (!seoId) { console.warn("Blog ConfigId not found"); return; } const response = await dispatch(getSeo({ PageId: seoId })).unwrap(); if (response?.data?.statusCode === 1 && response?.data?.data?.length > 0) { const data = response.data.data[0]; setSeoData({ metaTitle: data?.MetaTitle, metaDescription: data?.MetaDesc, keywords: data?.Keywords, imageAltText: data?.ImgAltText }); } } } catch (error) { console.log('No SEO data found for blog page'); } }; fetchSEOData(); }, [dispatch]); const fetchBlogPosts = async () => { try { const response = await dispatch(getPublishedBlogs()).unwrap(); if (response?.data.statusCode == 1) { setBlogPosts(response?.data?.data?.map((blog) => ({ id: blog?.BlogId, title: blog?.BlogTitle, excerpt: blog?.BlogSubtitle, author: blog?.BlogAuthor, date: (() => { if (!blog?.PublishDate) return ''; // --- Format date --- const dateStr = blog.PublishDate.split('T')[0]; // "2025-10-24" const [year, month, day] = dateStr.split('-'); const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const monthName = months[parseInt(month, 10) - 1]; const formattedDate = `${parseInt(day, 10)} ${monthName} ${year}`; // "24 Oct 2025" // --- Format time --- if (!blog?.PublishTime) return formattedDate; // If no time, return date only const [hourStr, minuteStr] = blog.PublishTime.split(':'); // "17:25:00" → ["17","25","00"] let hour = parseInt(hourStr, 10); const minute = minuteStr; const ampm = hour >= 12 ? "PM" : "AM"; hour = hour % 12 || 12; // Convert 0 → 12 const formattedTime = `${hour.toString().padStart(2, "0")}:${minute} ${ampm}`; // "05:25 PM" return `${formattedDate} ${formattedTime}`; // "24 Oct 2025 05:25 PM" })(), readTime: '5 min read', CreatedDate: (() => { if (!blog?.CreatedDate) return ''; const dateStr = blog.CreatedDate.split('T')[0]; // Get date part const [year, month, day] = dateStr.split('-'); const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; const monthName = months[parseInt(month) - 1]; return `${parseInt(day)} ${monthName} ${year}`; })(), imageUrl: blog?.HeaderImage, slug: blog?.Slug })) || []); } else { setBlogPosts([]); } } catch (err) { message.error('Failed to fetch blog posts. Please try again later.'); } } // const blogPosts = [ // { // id: 1, // title: "Modern Web Development Trends in 2024", // excerpt: "Explore the latest technologies and frameworks shaping the future of web development with React, Next.js and modern CSS.", // author: "John Doe", // date: "Dec 15, 2024", // readTime: "5 min read", // imageUrl: "https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=400", // }, // { // id: 2, // title: "Mastering React Hooks in 2024", // excerpt: "Learn how to effectively use React Hooks to build modern, efficient React applications with best practices.", // author: "Sarah Wilson", // date: "Dec 12, 2024", // readTime: "8 min read", // imageUrl: "https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=400", // }, // { // id: 3, // title: "CSS Grid vs Flexbox: When to Use What", // excerpt: "A comprehensive guide to understanding the differences between CSS Grid and Flexbox with practical examples.", // author: "Mike Chen", // date: "Dec 10, 2024", // readTime: "6 min read", // imageUrl: "https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=400", // } // ]; const redirectApp = (AppName, AppId) => { console.log('Redirect to app:', AppName, AppId); }; const handleIndustry = () => { if (industry) { setClosingIndustry(true); setTimeout(() => { setIndustry(false); setClosingIndustry(false); }, 200); } else { setIndustry(true); } }; const handleCompanyList = () => { if (company) { setClosingCompany(true); setTimeout(() => { setCompany(false); setClosingCompany(false); }, 200); } else { setCompany(true); } }; useEffect(() => { const lenis = new Lenis({ duration: 1.2, easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), smoothWheel: true, smoothTouch: true, }); lenis.on("scroll", (e) => { setIsScrolled(e.scroll > 50); }); function raf(time) { lenis.raf(time); requestAnimationFrame(raf); } requestAnimationFrame(raf); return () => lenis.destroy(); }, []); useEffect(() => { if (industry || company) { document.body.style.overflow = "hidden"; } else { document.body.style.overflow = "unset"; } return () => { document.body.style.overflow = "unset"; }; }, [industry, company]); const BlogCard = ({ post }) => { const handleClick = () => { navigate(`${subDirectory}blog/${post.slug}`); }; return (
{post.excerpt}
Stay updated with the latest news, announcements, and blog posts from PozoApp. Discover insights on business management, technology trends, and more.
No blog posts available at the moment. Please check back later for updates.
Quick Links
About Pozo
All Products
Pricing Plans
Contact Us
FAQs
Support & Help
For queries contact us: Manager, No 51 Step Colony, Dharga,Hosur, Krishnagiri, Tamilnadu-635126, India