"use client"; import React from "react"; const ContentContainer = ({ post, width = "200px", variant = "vertical" }) => { // Get the corresponding icon based on the same logic as background images const getIconImage = (slug, variant) => { const verticalIcons = [ "/assets/Content_Thumbnail/Icon_1.svg", "/assets/Content_Thumbnail/Icon_2.svg", "/assets/Content_Thumbnail/Icon_3.svg", ]; const horizontalIcons = [ "/assets/Content_Thumbnail/Icon_1.svg", "/assets/Content_Thumbnail/Icon_2.svg", "/assets/Content_Thumbnail/Icon_3.svg", ]; const icons = variant === "vertical" ? verticalIcons : horizontalIcons; if (!slug) return icons[0]; // Use the same hash logic as background images to ensure matching const hash = slug.split("").reduce((a, b) => { a = (a << 5) - a + b.charCodeAt(0); return a & a; }, 0); return icons[Math.abs(hash) % icons.length]; }; const iconImage = getIconImage(post.slug, variant); return (
{/* Content Container - 8px gap between icon and text */}
{/* Icon */}
{`Icon
{/* Text Container */}
{/* Title */}

{post.frontmatter.title}

{/* Description */}

{post.frontmatter.description}

{/* Metadata Container - horizontal with 8px gap */}
{/* Author Name */} {post.frontmatter.author} {/* Date */} {new Date(post.frontmatter.date).toLocaleDateString("en-US", { year: "numeric", month: "long", })}
); }; export default ContentContainer;