"use client"; import React from "react"; import Link from "next/link"; import ContentContainer from "./ContentContainer"; import { getAssetPath, ASSETS } from "../../lib/assetUtils"; /** * ContentThumbnailTemplate component for displaying blog post previews * Simplified version to debug infinite loop */ const ContentThumbnailTemplate = ({ post, className = "", variant = "vertical", // Internal prop for testing/development }) => { // Get article-specific background image from frontmatter const getBackgroundImage = (post, variant) => { // Check if post has thumbnail images defined in frontmatter if (post.frontmatter?.thumbnail) { const imageName = variant === "vertical" ? post.frontmatter.thumbnail.vertical : post.frontmatter.thumbnail.horizontal; if (imageName) { // Return path to image in content/blog directory return `/content/blog/${imageName}`; } } // Fallback to default images if no thumbnail specified const fallbackImages = { vertical: getAssetPath(ASSETS.VERTICAL_1), horizontal: getAssetPath(ASSETS.HORIZONTAL_1), }; return fallbackImages[variant] || fallbackImages.vertical; }; const backgroundImage = getBackgroundImage(post, variant); if (variant === "vertical") { return (