"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 slugOrder = [], // Array of slugs for consistent icon cycling }) => { // Post-specific background selection - different SVG for each post const getBackgroundImage = (slug, variant, slugOrder) => { 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), ]; if (!slug) return variant === "vertical" ? verticalImages[0] : horizontalImages[0]; // Use the passed slugOrder for consistent cycling through background variants const index = slugOrder.indexOf(slug); const backgroundIndex = index >= 0 ? index % 3 : 0; // Cycle through 3 background variants // Return the same background index for both vertical and horizontal variants return variant === "vertical" ? verticalImages[backgroundIndex] : horizontalImages[backgroundIndex]; }; const backgroundImage = getBackgroundImage(post.slug, variant, slugOrder); if (variant === "vertical") { return (