@@ -14,23 +14,7 @@ interface MVPTeamCardProps {
1414}
1515
1616export default function MVPTeamCard ( { team, className } : MVPTeamCardProps ) {
17- const weekLabel = ( ( ) => {
18- const dateSource = team . weekDate || team . weekStartDate ;
19- if ( ! dateSource ) return 'MVP 팀' ;
20-
21- const date = new Date ( dateSource ) ;
22- if ( Number . isNaN ( date . getTime ( ) ) ) return 'MVP 팀' ;
23-
24- const firstDayOfMonth = new Date (
25- date . getFullYear ( ) ,
26- date . getMonth ( ) ,
27- 1 ,
28- ) . getDay ( ) ;
29- const weekOfMonth =
30- Math . floor ( ( date . getDate ( ) + firstDayOfMonth - 1 ) / 7 ) + 1 ;
31-
32- return `${ date . getMonth ( ) + 1 } 월 ${ weekOfMonth } 주차 MVP 팀` ;
33- } ) ( ) ;
17+ const weekLabel = team . weekDate ?. trim ( ) ;
3418
3519 return (
3620 < div
@@ -53,7 +37,9 @@ export default function MVPTeamCard({ team, className }: MVPTeamCardProps) {
5337 trigger = {
5438 < button
5539 type = "button"
56- aria-label = "저번 주 MVP 팀 안내"
40+ aria-label = {
41+ weekLabel ? `${ weekLabel } MVP 팀 안내` : '최근 MVP 팀 안내'
42+ }
5743 className = "border-border-subtle text-text-strong bg-background-default shadow-1 font-designer-24b flex h-600 w-600 items-center justify-center rounded-full border leading-none"
5844 >
5945 ?
@@ -65,7 +51,7 @@ export default function MVPTeamCard({ team, className }: MVPTeamCardProps) {
6551 < div className = "relative z-10 flex h-full flex-col items-center justify-center gap-400 text-center" >
6652 < div className = "flex flex-col items-center gap-100" >
6753 < span className = "bg-fill-warning-subtle-default text-text-warning font-designer-12b border-border-warning-subtle rounded-[9999px] border px-150 py-50" >
68- { weekLabel }
54+ { weekLabel || '최근 MVP 팀' }
6955 </ span >
7056 < h3 className = "font-display-headings5 text-text-strong" >
7157 최고의 스터디 메이트
0 commit comments