File tree 3 files changed +45
-1
lines changed
src/pages/library/components
3 files changed +45
-1
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { Link } from 'waku/router/client'
4
4
import { encodeRFC3986URIComponent } from '@/utils/misc.ts'
5
5
import { getRomGoodcodes } from '@/utils/rom.ts'
6
6
import { useRomCover } from '../hooks/use-rom-cover.ts'
7
+ import { GameTitle } from './game-title.tsx'
7
8
8
9
export function GameEntry ( { rom, width } ) {
9
10
const goodcodes = getRomGoodcodes ( rom )
@@ -39,7 +40,7 @@ export function GameEntry({ rom, width }) {
39
40
) : null }
40
41
</ div >
41
42
42
- < div className = 'mt-2 line-clamp-2 text-center text-sm font-semibold' > { goodcodes . rom } { goodcodes . codes . languages } </ div >
43
+ < GameTitle rom = { rom } / >
43
44
</ Link >
44
45
</ div >
45
46
)
Original file line number Diff line number Diff line change
1
+ import { uniq } from 'es-toolkit'
2
+ import { getRomGoodcodes } from '@/utils/rom.ts'
3
+ import { DistrictIcon } from './district-icon.tsx'
4
+
5
+ export function GameTitle ( { rom } ) {
6
+ const goodcodes = getRomGoodcodes ( rom )
7
+
8
+ const { countries, revision, version = { } } = goodcodes . codes
9
+ const districts : string [ ] = uniq ( countries ?. map ( ( { code } ) => code ) )
10
+
11
+ return (
12
+ < div className = 'mt-2 line-clamp-2 text-center text-sm font-semibold' >
13
+ { districts ?. map ( ( district ) => (
14
+ < DistrictIcon district = { district } key = { district } />
15
+ ) ) }
16
+
17
+ { goodcodes . rom }
18
+
19
+ { revision !== undefined && (
20
+ < span className = 'ml-2 inline-block rounded bg-gray-300 px-1' >
21
+ < span className = 'icon-[octicon--versions-16] size-4 align-middle' />
22
+ { revision > 1 && (
23
+ < span className = 'ml-2 h-4 align-middle font-["Noto_Mono",ui-monospace,monospace]' > { revision } </ span >
24
+ ) }
25
+ </ span >
26
+ ) }
27
+
28
+ { version . alpha ? (
29
+ < span className = 'ml-2 inline-block rounded bg-gray-300 px-1' >
30
+ < span className = 'icon-[mdi--alpha] size-4 align-middle' />
31
+ </ span >
32
+ ) : version . beta ? (
33
+ < span className = 'ml-2 inline-block rounded bg-gray-300 px-1' >
34
+ < span className = 'icon-[mdi--beta] size-4 align-middle' />
35
+ </ span >
36
+ ) : version . prototype ? (
37
+ < span className = 'ml-2 inline-block rounded bg-gray-300 px-1' >
38
+ < span className = 'icon-[mdi--flask] size-4 align-middle' />
39
+ </ span >
40
+ ) : null }
41
+ </ div >
42
+ )
43
+ }
You can’t perform that action at this time.
0 commit comments