'use client' import { use } from 'react' import { redirect, RedirectType } from 'next/navigation' import { useSharedData } from '@/app/context/ProjectContext'; import { useMountTransition } from '@/hooks/useAnimations'; import "../../../styles/markdown-container.css"; import Link from 'next/link'; import { PROJECTS } from '@/data/content'; export default function ProjectPage({ params, }: {params: Promise<{ slug: string }>}) { const mounted = useMountTransition(50) const { slug } = use(params); if (!slug) redirect('project',RedirectType.replace); const hasValidProject = PROJECTS.find((v)=>v.slug == slug) const hasValidDetails = hasValidProject && PROJECTS.find((v)=>v.slug == slug)?.details const projectDetails = useSharedData(); return (
{ hasValidDetails ? (
) : (

This project has no details set up for it yet.

) }
{ window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }} className="expand-on-hover-button" href={"#"}>Back To Top { window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }} className="expand-on-hover-button" href={"/project"}>More Projects
); }