@@ -2,7 +2,6 @@ import fs from "fs";
22import path from "path" ;
33import styles from "./page.module.css" ;
44import Image from "next/image" ;
5- import Link from "next/link" ;
65
76interface MusicJson {
87 title ?: string ;
@@ -35,10 +34,10 @@ export function getMusicList(): Music[] {
3534 // 音楽ファイルとジャケット画像を探す
3635 const musicFile = files . find (
3736 ( file ) =>
38- file . endsWith ( ".mp3" ) || file . endsWith ( ".m4a" ) || file . endsWith ( ".wav" ) ,
37+ file . endsWith ( ".mp3" ) || file . endsWith ( ".m4a" ) || file . endsWith ( ".wav" )
3938 ) ;
4039 const jacketFile = files . find (
41- ( file ) => file . startsWith ( "jacket." ) || file . startsWith ( "cover." ) ,
40+ ( file ) => file . startsWith ( "jacket." ) || file . startsWith ( "cover." )
4241 ) ;
4342
4443 // music.jsonを読み込む
@@ -63,16 +62,18 @@ export function getMusicList(): Music[] {
6362 artist : jsonData . artist || "The Infinitys" ,
6463 url : `/music/${ folder } /${ musicFile } ` ,
6564 jacketUrl : jacketFile ? `/music/${ folder } /${ jacketFile } ` : undefined ,
66- // TODO: Replace hardcoded duration with actual music duration
67- duration : 10000 ,
65+ duration : 10000 , // init with 10000
6866 date : jsonData . date ,
6967 } ;
7068 } ) ;
7169}
7270
7371export function MusicCard ( { music } : { music : Music } ) {
7472 return (
75- < Link href = { `/music/${ music . id } ` } className = { styles [ "music-card" ] } >
73+ < a
74+ href = { `/music/${ music . id } ` }
75+ className = { styles [ "music-card" ] }
76+ >
7677 { music . jacketUrl && (
7778 < Image
7879 src = { music . jacketUrl }
@@ -86,6 +87,6 @@ export function MusicCard({ music }: { music: Music }) {
8687 < h2 > { music . title } </ h2 >
8788 < p > { music . artist } </ p >
8889 </ div >
89- </ Link >
90+ </ a >
9091 ) ;
9192}
0 commit comments