'use client' import React from 'react' interface BlogImagePlaceholderProps { /** Cover-image URL. The hub passes a `useOgPlaceholderUrl({ title, siteName })` * result; embedders pass their own pre-resolved URL. When null, the * component renders nothing. */ imageUrl: string | null /** Used for the `alt` attribute. */ title: string className?: string } /** * Pure presentation wrapper for a cover-image / OG-placeholder fallback. * * Outer must be inline-content-model so this placeholder is HTML-valid * when rendered inside a markdown `

` (e.g. via the chat shell's * compact `BlogCard` fallback). `` keeps the * same visual behavior as the prior `

` while satisfying the * phrasing-content constraint of its parent. * * If the `imageUrl` itself 404s (cold cache, transient failure), the * `onError` handler hides the broken-image icon so the parent's * `bg-ods-bg` shows through cleanly. Same recovery pattern every * cover-image render path uses. */ export function BlogImagePlaceholder({ imageUrl, title, className = '', }: BlogImagePlaceholderProps) { if (!imageUrl) return null return ( {/* eslint-disable-next-line @next/next/no-img-element -- this is a dynamically-generated placeholder image with a query string; next/image's loader configuration adds nothing here. */} {`Cover { (e.currentTarget as HTMLImageElement).style.display = 'none' }} /> ) }