"use client"; import { motion } from "framer-motion"; import { ExternalLink, Calendar, ArrowLeft, Github as GithubIcon, Share2 } from "lucide-react"; import Link from "next/link"; import { useEffect } from "react"; import ReactMarkdown from "react-markdown"; export type ProjectDetailData = { id: number; slug: string; title: string; description: string; content: string; tags: string[]; featured: boolean; category: string; date: string; github?: string | null; live?: string | null; imageUrl?: string | null; }; export default function ProjectDetailClient({ project, locale, }: { project: ProjectDetailData; locale: string; }) { // Track page view (non-blocking) useEffect(() => { try { navigator.sendBeacon?.( "/api/analytics/track", new Blob( [ JSON.stringify({ type: "pageview", projectId: project.id.toString(), page: `/${locale}/projects/${project.slug}`, }), ], { type: "application/json" }, ), ); } catch { // ignore } }, [project.id, project.slug, locale]); return (
{project.description}
{children}
, li: ({ children }) =>
{children}
),
pre: ({ children }) => (
{children}
),
}}
>
{project.content}