'use client' import dynamic from 'next/dynamic' const BlockViewer = dynamic( () => import('@/components/shared/block-editor').then((mod) => mod.BlockViewer), { ssr: false, loading: () => (
), } ) interface ResourceRendererProps { title: string description?: string | null contentJson: unknown // BlockNote PartialBlock[] stored as JSON coverImageUrl?: string | null className?: string } export function ResourceRenderer({ title, description, contentJson, coverImageUrl, className, }: ResourceRendererProps) { const contentString = typeof contentJson === 'string' ? contentJson : JSON.stringify(contentJson) return (
{/* Cover image */} {coverImageUrl && (
)} {/* Title */}

{title}

{/* Description */} {description && (

{description}

)} {/* Divider */}
{/* Content */} {contentJson ? (
) : (

No content

)}
) }