"use client"; import { ArrowLeft, Github, Twitter } from "lucide-react"; import Link from "next/link"; import React, { useEffect, useMemo, useRef, useState } from "react"; import { usePathname } from "next/navigation"; import Balancer from "react-wrap-balancer"; type Props = { project: { url?: string; title: string; description: string; repository?: string; }; }; export const Header: React.FC = ({ project }) => { const pathname = usePathname(); const ref = useRef(null); const [isIntersecting, setIntersecting] = useState(true); const links: { label: string; href: string }[] = []; if (project.repository) { links.push({ label: "GitHub", href: `https://github.com/${project.repository}`, }); } if (project.url) { links.push({ label: "Live", href: project.url, }); } useEffect(() => { if (!ref.current) return; const observer = new IntersectionObserver(([entry]) => setIntersecting(entry.isIntersecting), ); observer.observe(ref.current); return () => observer.disconnect(); }, []); return (

{project.title}

{project.description}

{links.map((link) => ( {link.label} ))}
); };