import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { api, type Project, type SiteSettings, type Category } from "../lib/api"; import { ProjectCard } from "../components/ProjectCard"; import "./HomePage.scss"; export function HomePage() { const [site, setSite] = useState(null); const [featured, setFeatured] = useState([]); const [recent, setRecent] = useState([]); const [categories, setCategories] = useState([]); useEffect(() => { Promise.all([ api.site(), api.featured().catch(() => [] as Project[]), api.projects({ sort: "date", perPage: 6 }), api.categories(), ]).then(([s, f, r, c]) => { setSite(s); setFeatured(f); setRecent(r.data); setCategories(c); }); }, []); const heroTitle = site?.heroTitle || site?.name || "jmartgraphix"; const heroSub = site?.heroSubtitle || "3D · Design · Motion · Craft"; return (
jmartgraphix

Portfolio

{heroTitle}

{heroSub}

{site?.about || "A curated collection of 3D modeling, CAD, animation, and visual design."}

View portfolio Resume
{categories.map((c) => ( {c.name} {typeof c.projectCount === "number" && ( {c.projectCount} )} ))} Game Dev view Engineering view
{featured.length > 0 && (

Featured

All work →
{featured.map((p, i) => ( ))}
)}

Recent

{recent.length === 0 ? (

Projects will appear here once published.

) : (
{recent.map((p, i) => ( ))}
)}
); }