1
+ import { getRomPlatformCount } from '@/controllers/get-rom-platform-count.ts'
1
2
import { getRoms } from '@/controllers/get-roms.ts'
2
3
import AppLayout from './components/app-layout.tsx'
3
4
import { GameList } from './components/game-list.tsx'
4
5
5
6
export async function LibraryPage ( { query } : { query : string } ) {
6
7
const page = Number . parseInt ( new URLSearchParams ( query ) . get ( 'page' ) || '' , 10 ) || 1
7
- const { pagination, roms } = await getRoms ( { page } )
8
+ const [ { pagination, roms } , platformCount ] = await Promise . all ( [ getRoms ( { page } ) , getRomPlatformCount ( ) ] )
8
9
9
10
if ( page > 1 && roms . length === 0 ) {
10
11
return '404'
@@ -15,11 +16,11 @@ export async function LibraryPage({ query }: { query: string }) {
15
16
< title > Library - RetroAssembly</ title >
16
17
< div className = 'flex flex-col gap-5' >
17
18
< div className = 'relative flex justify-between px-4 pt-4' >
18
- < h1 className = 'text-5xl font-[Oswald_Variable] font-semibold' > Library { page } </ h1 >
19
+ < h1 className = 'text-5xl font-[Oswald_Variable] font-semibold' > Library</ h1 >
19
20
< div className = 'mt-4 flex items-center gap-2 text-zinc-400' >
20
21
< span className = 'icon-[mdi--bar-chart] text-black' />
21
22
< span className = 'font-[DSEG7_Modern] font-bold text-rose-700' > { roms . length } </ span > games for{ ' ' }
22
- < span className = 'font-[DSEG7_Modern] font-bold text-rose-700' > { 8 } </ span > platforms in total
23
+ < span className = 'font-[DSEG7_Modern] font-bold text-rose-700' > { platformCount } </ span > platforms in total
23
24
</ div >
24
25
</ div >
25
26
< hr className = 'border-t-1 border-t-black/20' />
0 commit comments