"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 }) => { // Post-specific background selection - different SVG for each post const getBackgroundImage = (slug, variant) => { const verticalImages = [ getAssetPath(ASSETS.VERTICAL_1), getAssetPath(ASSETS.VERTICAL_2), getAssetPath(ASSETS.VERTICAL_3), ]; const horizontalImages = [ getAssetPath(ASSETS.HORIZONTAL_1), getAssetPath(ASSETS.HORIZONTAL_2), getAssetPath(ASSETS.HORIZONTAL_3), ]; const images = variant === "vertical" ? verticalImages : horizontalImages; if (!slug) return images[0]; // Use the slug to deterministically select an image // More robust hash function using djb2 algorithm let hash = 5381; for (let i = 0; i < slug.length; i++) { hash = (hash << 5) + hash + slug.charCodeAt(i); } // Ensure positive number and get index const index = Math.abs(hash) % images.length; return images[index]; }; const backgroundImage = getBackgroundImage(post.slug, variant); if (variant === "vertical") { return (