'use client' import Link from "next/link"; import Blogs from "@/utils/constant.utils"; const truncateWords = (text, limit) => { const words = text.split(" "); return words.length > limit ? words.slice(0, limit).join(" ") + " ..." : text; }; const stripHtml = (html) => { if (!html) return ""; return html.replace(/<[^>]*>/g, ""); }; export default function Blog() { return (
{Blogs.map((blog) => (
{/* Blog Image */}
{blog.title}
{/* Blog Title */}

{stripHtml(blog.title)}

{/* Blog Excerpt */}

{truncateWords(stripHtml(blog.para))}

{/* Read More Button */} Read More
))}
); }