"use client"; import { motion } from 'framer-motion'; import { ExternalLink, Calendar, Tag, ArrowLeft, Github as GithubIcon } from 'lucide-react'; import Link from 'next/link'; import { useParams } from 'next/navigation'; import { useState, useEffect } from 'react'; import ReactMarkdown from 'react-markdown'; interface Project { id: number; title: string; description: string; content: string; tags: string[]; featured: boolean; category: string; date: string; github?: string; live?: string; } const ProjectDetail = () => { const params = useParams(); const slug = params.slug as string; const [project, setProject] = useState(null); // Load project from localStorage by slug useEffect(() => { const savedProjects = localStorage.getItem('portfolio-projects'); if (savedProjects) { const projects = JSON.parse(savedProjects); const foundProject = projects.find((p: Project) => p.title.toLowerCase().replace(/[^a-z0-9]+/g, '-') === slug ); if (foundProject) { setProject(foundProject); } } }, [slug]); if (!project) { return (

Loading project...

); } return (
{/* Header */} Back to Projects

{project.title}

{project.featured && ( Featured )}

{project.description}

{/* Project Meta */}
{project.date}
{project.category}
{/* Tags */}
{project.tags.map((tag) => ( {tag} ))}
{/* Action Buttons */}
View Code {project.live !== "#" && ( Live Demo )}
{/* Project Content */}

{children}

, h2: ({children}) =>

{children}

, h3: ({children}) =>

{children}

, p: ({children}) =>

{children}

, ul: ({children}) =>
    {children}
, ol: ({children}) =>
    {children}
, li: ({children}) =>
  • {children}
  • , a: ({href, children}) => ( {children} ), code: ({children}) => {children}, pre: ({children}) =>
    {children}
    , blockquote: ({children}) =>
    {children}
    , strong: ({children}) => {children}, em: ({children}) => {children} }} > {project.content}
    ); }; export default ProjectDetail;