11import Link from "next/link" ;
22import Image from "next/image" ;
3- import { db , archiveYears , archiveCategories , archiveContent , archivePapers } from "@/db/schema" ;
3+ import {
4+ db ,
5+ archiveYears ,
6+ archiveCategories ,
7+ archiveContent ,
8+ archivePapers ,
9+ } from "@/db/schema" ;
410import { eq , and } from "drizzle-orm" ;
511import { notFound } from "next/navigation" ;
612
7- export const dynamic = 'force-dynamic' ;
13+ export const dynamic = "force-dynamic" ;
14+
15+ export default async function ArchiveYearPage ( {
16+ params,
17+ } : {
18+ params : Promise < { year : string } > ;
19+ } ) {
20+ const { year : yearStr } = await params ;
21+ const yearNumber = Number . parseInt ( yearStr , 10 ) ;
22+
23+ if ( Number . isNaN ( yearNumber ) ) {
24+ notFound ( ) ;
25+ }
26+
27+ const yearData = await db
28+ . select ( )
29+ . from ( archiveYears )
30+ . where ( eq ( archiveYears . year , yearNumber ) )
31+ . limit ( 1 ) ;
832
9- export default async function Archive2025Page ( ) {
10- const yearData = await db . select ( ) . from ( archiveYears ) . where ( eq ( archiveYears . year , 2025 ) ) . limit ( 1 ) ;
11-
1233 if ( yearData . length === 0 ) {
1334 notFound ( ) ;
1435 }
1536
1637 const year = yearData [ 0 ] ;
17- const categories = await db . select ( ) . from ( archiveCategories ) . orderBy ( archiveCategories . displayOrder ) ;
18-
38+ const categories = await db
39+ . select ( )
40+ . from ( archiveCategories )
41+ . orderBy ( archiveCategories . displayOrder ) ;
42+
1943 const contentByCategory = new Map < string , typeof archiveContent . $inferSelect [ ] > ( ) ;
2044 for ( const category of categories ) {
2145 const content = await db
@@ -35,17 +59,17 @@ export default async function Archive2025Page() {
3559 . select ( )
3660 . from ( archivePapers )
3761 . where (
38- and (
39- eq ( archivePapers . yearId , year . id ) ,
40- eq ( archivePapers . isAccepted , true )
41- )
62+ and ( eq ( archivePapers . yearId , year . id ) , eq ( archivePapers . isAccepted , true ) )
4263 ) ;
4364
4465 return (
4566 < div className = "container mx-auto px-4 py-16" >
4667 < div className = "max-w-6xl mx-auto" >
4768 < div className = "mb-8" >
48- < Link href = "/archive" className = "text-sm text-muted-foreground hover:text-foreground" >
69+ < Link
70+ href = "/archive"
71+ className = "text-sm text-muted-foreground hover:text-foreground"
72+ >
4973 ← Back to Archives
5074 </ Link >
5175 </ div >
@@ -69,9 +93,7 @@ export default async function Archive2025Page() {
6993 { year . eventDate && < span > { year . eventDate } </ span > }
7094 { year . location && < span > • { year . location } </ span > }
7195 </ div >
72- { year . description && (
73- < p className = "text-lg" > { year . description } </ p >
74- ) }
96+ { year . description && < p className = "text-lg" > { year . description } </ p > }
7597 </ div >
7698
7799 < div className = "space-y-12" >
@@ -85,7 +107,9 @@ export default async function Archive2025Page() {
85107 { papers . map ( ( paper ) => (
86108 < div key = { paper . id } className = "border rounded-lg p-6" >
87109 < h3 className = "text-xl font-semibold mb-2" > { paper . title } </ h3 >
88- < p className = "text-sm text-muted-foreground mb-2" > by { paper . authors } </ p >
110+ < p className = "text-sm text-muted-foreground mb-2" >
111+ by { paper . authors }
112+ </ p >
89113 { paper . trackType && (
90114 < span className = "inline-block text-xs px-2 py-1 rounded bg-muted mb-3" >
91115 { paper . trackType }
@@ -110,8 +134,8 @@ export default async function Archive2025Page() {
110134
111135 { categories . map ( ( category ) => {
112136 const items = contentByCategory . get ( category . id ) || [ ] ;
113- if ( items . length === 0 && category . slug !== ' abstract-book' ) return null ;
114- if ( category . slug === ' papers' ) return null ;
137+ if ( items . length === 0 && category . slug !== " abstract-book" ) return null ;
138+ if ( category . slug === " papers" ) return null ;
115139
116140 return (
117141 < section key = { category . id } id = { category . slug } >
0 commit comments