import React from 'react'; import Link from 'next/link'; import { PostMdx } from '@/lib/blog'; interface PostNavigationProps { prev: PostMdx | null; next: PostMdx | null; locale: string; } export default function PostNavigation({ prev, next, locale }: PostNavigationProps) { if (!prev && !next) return null; return (
{/* Previous Post (Older) */} {prev ? ( {/* Background Image */} {prev.frontmatter.featuredImage ? (
) : (
)} {/* Overlay */}
{/* Content */}
{locale === 'de' ? 'Vorheriger Beitrag' : 'Previous Post'}

{prev.frontmatter.title}

{/* Arrow Icon */}
) : (
)} {/* Next Post (Newer) */} {next ? ( {/* Background Image */} {next.frontmatter.featuredImage ? (
) : (
)} {/* Overlay */}
{/* Content */}
{locale === 'de' ? 'Nächster Beitrag' : 'Next Post'}

{next.frontmatter.title}

{/* Arrow Icon */}
) : (
)}
); }