"use client"; import { motion, useScroll, useSpring } from "framer-motion"; import Link from "next/link"; import Header from "@/components/Header"; import Footer from "@/components/Footer"; import type { Locale } from "@/i18n-config"; import type { BlogPost } from "@/data/blog"; const expo = [0.16, 1, 0.3, 1] as [number, number, number, number]; export default function BlogDetailClient({ lang, dict, post, }: { lang: Locale; dict: any; post: BlogPost; }) { const { scrollYProgress } = useScroll(); const scaleX = useSpring(scrollYProgress, { stiffness: 100, damping: 30, restDelta: 0.001, }); const content = post[lang] || post.en; const accent = "#FFE600"; // Signature yellow return (
{/* Scroll indicator */}
{/* Back Link */} {dict.blog.back} {/* Article Metadata */}
{content.category} {post.date} {content.readingTime}
{/* Title */} {content.title} {/* Author Bio Row */}
{post.author.charAt(0)}{post.author.split(" ")[1]?.charAt(0)}
{post.author}
{post.authorRole}
{/* Featured Image */} {post.image && ( {content.title} )} {/* Article Body Content */} {/* Render paragraph chunks dynamically */} {content.content.split("\n\n").map((paragraph, index) => { if (paragraph.startsWith("## ")) { return (

{paragraph.replace("## ", "")}

); } if (paragraph.startsWith("### ")) { return (

{paragraph.replace("### ", "")}

); } if (paragraph.startsWith("> ")) { return (
{paragraph.replace("> ", "")}
); } if (paragraph.startsWith("- ")) { return (
    {paragraph.split("\n").map((li, idx) => (
  • {li.replace("- ", "")}
  • ))}
); } if (paragraph.includes("```")) { const codeLines = paragraph.split("\n").filter(l => !l.includes("```")); const codeHeader = codeLines[0]?.startsWith("//") ? codeLines.shift() : ""; return (
{codeHeader &&
{codeHeader}
}
{codeLines.join("\n")}
); } return

{paragraph}

; })}
{/* Tags Block */}
{content.tags.map((tag) => ( #{tag} ))}
); }