import { notFound } from 'next/navigation'; import { MDXRemote } from 'next-mdx-remote/rsc'; import { getPostBySlug } 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'; const components = { VisualLinkPreview, Callout, HighlightBox, Stats, a: ({ href, children, ...props }: any) => { if (href?.startsWith('/')) { return ( {children} ); } return ( {children} ); }, img: (props: any) => (
{props.alt && (

{props.alt}

)}
), 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}
        
    ), }; export default async function BlogPost({ params: { locale, slug } }: BlogPostProps) { const post = await getPostBySlug(slug, locale); if (!post) { notFound(); } return (
    {/* Featured Image Header */} {post.frontmatter.featuredImage && (
    {post.frontmatter.title}
    {/* Title overlay on image */}
    {post.frontmatter.category && ( {post.frontmatter.category} )}

    {post.frontmatter.title}

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

    {post.frontmatter.title}

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

    {post.frontmatter.excerpt}

    )} {/* Main content with enhanced styling */}
    {/* Call to action section */}

    {locale === 'de' ? 'Haben Sie Fragen?' : 'Have questions?'}

    {locale === 'de' ? 'Unser Team steht Ihnen gerne zur Verfügung. Kontaktieren Sie uns für weitere Informationen zu unseren Kabellösungen.' : 'Our team is happy to help. Contact us for more information about our cable solutions.'}

    {locale === 'de' ? 'Kontakt aufnehmen' : 'Get in touch'}
    {/* Back to blog link */}
    {locale === 'de' ? 'Zurück zum Blog' : 'Back to Blog'}
    ); }