"use client"; import React, { memo } from "react"; import { getAssetPath } from "../../lib/assetUtils"; import ContentContainer from "./ContentContainer"; import type { BlogPost } from "../../lib/content"; interface ContentBannerProps { post: BlogPost; } const ContentBanner = memo(({ post }) => { // Get article-specific horizontal thumbnail (small) and banner (md+) const getBackgroundImage = (post: BlogPost): string => { if (post.frontmatter?.thumbnail?.horizontal) { return `/content/blog/${post.frontmatter.thumbnail.horizontal}`; } // Fallback to default image return getAssetPath("assets/Content_Banner.svg"); }; const getBannerImageMd = (post: BlogPost): string => { // Use banner.horizontal when provided; fallback to horizontal thumbnail if (post.frontmatter?.banner?.horizontal) { return `/content/blog/${post.frontmatter.banner.horizontal}`; } // Fallback to horizontal thumbnail, then default banner if (post.frontmatter?.thumbnail?.horizontal) { return `/content/blog/${post.frontmatter.thumbnail.horizontal}`; } return getAssetPath("assets/Content_Banner_2.svg"); }; const backgroundImage = getBackgroundImage(post); const bannerImageMd = getBannerImageMd(post); return (
{/* Background SVG - Default to sm breakpoint */}
{/* Background SVG - md breakpoint and above (article banner image) */}
{/* Content Container */}
{/* ContentContainer with post data */}
); }); ContentBanner.displayName = "ContentBanner"; export default ContentBanner;