"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]; // Simple cycling approach to ensure different styles const slugOrder = [ "building-community-trust", "operational-security-mutual-aid", "making-decisions-without-hierarchy", "resolving-active-conflicts", ]; const index = slugOrder.indexOf(slug); const finalIndex = index >= 0 ? index % images.length : 0; return images[finalIndex]; }; const backgroundImage = getBackgroundImage(post.slug, variant); if (variant === "vertical") { return (
{/* Background SVG - sized to fit the 260x390 container exactly */}
{/* eslint-disable-next-line @next/next/no-img-element */} {`Background {/* Gradient overlay for better text readability */}
{/* Content Section - positioned within the padding constraints */}
); } // Horizontal variant return (
{/* Background SVG - sized to fit the 320x225.5 container exactly */}
{/* eslint-disable-next-line @next/next/no-img-element */} {`Background {/* Gradient overlay */}
{/* Content - positioned within the padding constraints */}
); }; export default ContentThumbnailTemplate;