"use client"; import React, { useEffect, useState } from "react"; import { CategoryNav } from "./_components/CategoryNav"; import { getPublications, getPatents } from "../../lib/api"; import type { Publication, Patent } from "../../content/types"; export default function PublicationsIndexPage() { const [publications, setPublications] = useState([]); const [patents, setPatents] = useState([]); useEffect(() => { getPublications().then((p) => { if (p) setPublications(p); }); getPatents().then((pat) => { if (pat) setPatents(pat); }); }, []); const counts = { "intl-journal-conf": publications.filter((p) => p.category === "intl-journal-conf").length, "domestic-journal-conf": publications.filter((p) => p.category === "domestic-journal-conf").length, patent: patents.length, }; // Selected representative publications (curated via database isHighlight flag) const highlights = publications.filter((p) => p.isHighlight); return (
{/* Page Header */}

PUBLICATIONS

{/* Category Summary Cards */}
{/* Highlights Section */}

Highlights

{highlights.map((pub, idx) => (
{pub.publishedAt?.substring(0, 7) || "Recent"} · {pub.category.replace(/-/g, " ")} {pub.doi && ( <> · DOI: {pub.doi} )}

{pub.title}

{pub.authors && (

{pub.authors}

)} {pub.venue && (

{pub.venue}{pub.volume ? `, ${pub.volume}` : ""}

)}
))}
); }