@@ -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
1313export 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