import React from "react"; import { Link } from "react-router-dom"; import BlogImg1 from "../../assets/images/blog/p1.jpg"; /** * Renders a sidebar for a blog. * @param {Object} blogs - An object containing the data for the blog posts. * @returns {JSX.Element} - JSX code that renders the blog sidebar. */ function BlogSideBar({ blogs }) { /** * Renders other blog posts. * This is an Array of JSX elements representing the other blog posts. */ const renderOtherBlogPosts = () => { return blogs?.blogdata?.slice(0, 4).map((post) => { const blogDate = new Date(post.post_date).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", }); const blogImg = post.meta_value != null ? `${blogs?.image_url}/${post.meta_value}` : BlogImg1; return (
blog-img
{post?.post_title}
{blogDate}
); }); }; return (
{/**/}
); } export default BlogSideBar;