Skip to content

Commit 5651d1d

Browse files
authored
Update page.tsx
Fix build error?
1 parent 2d3aff1 commit 5651d1d

1 file changed

Lines changed: 1 addition & 35 deletions

File tree

app/publication/page.tsx

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ interface Publication {
77
id: number;
88
title: string;
99
doi: string;
10-
year: number; // Add year field
10+
year: number;
1111
}
1212

1313
export default function Publications() {
14-
const [publications, setPublications] = useState<Publication[]>([]);
1514
const [groupedPublications, setGroupedPublications] = useState<{ [year: number]: Publication[] }>({});
1615

1716
useEffect(() => {
1817
fetch("/data/publication.json")
1918
.then((response) => response.json())
2019
.then((data) => {
21-
setPublications(data);
22-
2320
// Group publications by year
2421
const grouped = data.reduce((acc: { [year: number]: Publication[] }, pub: Publication) => {
2522
const year = pub.year;
@@ -50,34 +47,3 @@ export default function Publications() {
5047
</div>
5148
<hr className="border-t border-gray-600 w-11/12 md:w-3/4 mx-auto mb-8" />
5249
<div className="flex flex-col w-full">
53-
<div className="flex flex-col w-11/12 md:w-3/4 mx-auto">
54-
{sortedYears.map((year) => (
55-
<div key={year} className="mb-8">
56-
{/* Year sub-header */}
57-
<h2 className="text-xl md:text-2xl font-semibold mb-4 text-gray-800">
58-
{year}
59-
</h2>
60-
61-
{/* Publications for this year */}
62-
<ul className="list-disc pl-5 space-y-4">
63-
{groupedPublications[year].map((publication) => (
64-
<li key={publication.id}>
65-
{publication.title}{" "}
66-
<Link
67-
href={publication.doi}
68-
target="_blank"
69-
rel="noopener noreferrer"
70-
className="text-blue-500 hover:underline"
71-
>
72-
(DOI)
73-
</Link>
74-
</li>
75-
))}
76-
</ul>
77-
</div>
78-
))}
79-
</div>
80-
</div>
81-
</>
82-
);
83-
}

0 commit comments

Comments
 (0)