import { notFound } from 'next/navigation'; import { MDXRemote } from 'next-mdx-remote/rsc'; import { getPostBySlug, getAdjacentPosts } from '@/lib/blog'; interface BlogPostProps { params: { locale: string; slug: string; }; } import Link from 'next/link'; import Image from 'next/image'; import VisualLinkPreview from '@/components/blog/VisualLinkPreview'; import Callout from '@/components/blog/Callout'; import HighlightBox from '@/components/blog/HighlightBox'; import Stats from '@/components/blog/Stats'; import AnimatedImage from '@/components/blog/AnimatedImage'; import ChatBubble from '@/components/blog/ChatBubble'; import SplitHeading from '@/components/blog/SplitHeading'; import PostNavigation from '@/components/blog/PostNavigation'; import PowerCTA from '@/components/blog/PowerCTA'; const components = { VisualLinkPreview, Callout, HighlightBox, Stats, AnimatedImage, ChatBubble, PowerCTA, SplitHeading, a: ({ href, children, ...props }: any) => { if (href?.startsWith('/')) { return ( {children} ); } return ( {children} ); }, img: (props: any) => ( ), h2: ({ children, ...props }: any) => ( {children} ), h3: ({ children, ...props }: any) => (

{children}

), p: ({ children, ...props }: any) => (

{children}

), ul: ({ children, ...props }: any) => ( ), ol: ({ children, ...props }: any) => (
    {children}
), li: ({ children, ...props }: any) => (
  • {children}
  • ), blockquote: ({ children, ...props }: any) => (
    {children}
    ), strong: ({ children, ...props }: any) => ( {children} ), code: ({ children, ...props }: any) => ( {children} ), pre: ({ children, ...props }: any) => (
          {children}
        
    ), table: ({ children, ...props }: any) => (
    {children}
    ), thead: ({ children, ...props }: any) => ( {children} ), tbody: ({ children, ...props }: any) => ( {children} ), tr: ({ children, ...props }: any) => ( {children} ), th: ({ children, ...props }: any) => ( {children} ), td: ({ children, ...props }: any) => ( {children} ), }; export default async function BlogPost({ params: { locale, slug } }: BlogPostProps) { const post = await getPostBySlug(slug, locale); const { prev, next } = await getAdjacentPosts(slug, locale); if (!post) { notFound(); } return (
    {/* Featured Image Header */} {post.frontmatter.featuredImage && (
    {/* Title overlay on image */}
    {post.frontmatter.category && ( {post.frontmatter.category} )}

    {post.frontmatter.title}

    KLZ Cables
    )} {/* Content */}
    {/* If no featured image, show header here */} {!post.frontmatter.featuredImage && (
    {post.frontmatter.category && (
    {post.frontmatter.category}
    )}

    {post.frontmatter.title}

    KLZ Cables
    )} {/* Excerpt/Lead paragraph if available */} {post.frontmatter.excerpt && (

    {post.frontmatter.excerpt}

    )} {/* Main content with enhanced styling */}
    {/* Power CTA */}
    {/* Post Navigation */} {/* Back to blog link */}
    {locale === 'de' ? 'Zurück zur Übersicht' : 'Back to Overview'}
    ); }