@@ -8,6 +8,7 @@ import Link from "next/link";
8
8
import type { ComponentProps } from "react" ;
9
9
import type { StudyList } from "types/dtos/applyStudy" ;
10
10
import type { StudyType } from "types/entities/common/study" ;
11
+ import type { Time } from "types/entities/common/time" ;
11
12
import Button from "wowds-ui/Button" ;
12
13
import Tag from "wowds-ui/Tag" ;
13
14
interface StudyItemProps {
@@ -24,18 +25,25 @@ const StudyItem = ({ study, appliedStudyId }: StudyItemProps) => {
24
25
mentorName,
25
26
studyType,
26
27
dayOfWeek,
27
- startTime : { hour : startTimeHour , minute : startTimeMinute } ,
28
- endTime : { hour : endTimeHour , minute : endTimeMinute } ,
28
+ startTime,
29
+ endTime,
29
30
openingDate : openingDateString ,
30
31
applicationEndDate : endDateString ,
31
32
totalWeek,
32
33
} = study ;
33
34
34
35
const openingDate = parseISODate ( openingDateString ) ;
35
36
const endDate = parseISODate ( endDateString ) ;
36
- const studyTime = `${ dayToKorean [ dayOfWeek . toUpperCase ( ) ] } ${ startTimeHour } :${ padWithZero ( startTimeMinute ) } - ${
37
- endTimeHour
38
- } :${ padWithZero ( endTimeMinute ) } `;
37
+
38
+ const formatTime = ( startTime : Time , endTime : Time ) => {
39
+ const { hour : startTimeHour , minute : startTimeMinute } = startTime ;
40
+ const { hour : endTimeHour , minute : endTimeMinute } = endTime ;
41
+
42
+ return `${ dayToKorean [ dayOfWeek . toUpperCase ( ) ] } ${ startTimeHour } :${ padWithZero ( startTimeMinute ) } - ${
43
+ endTimeHour
44
+ } :${ padWithZero ( endTimeMinute ) } `;
45
+ } ;
46
+ const studyTime = startTime && endTime ? formatTime ( startTime , endTime ) : "-" ;
39
47
40
48
const isApplicable = appliedStudyId === null ;
41
49
const isCancelable = appliedStudyId === studyId ;
@@ -56,7 +64,12 @@ const StudyItem = ({ study, appliedStudyId }: StudyItemProps) => {
56
64
</ Link >
57
65
</ Flex >
58
66
< Text className = { textCellStyle } > { mentorName } </ Text >
59
- < Text className = { textCellStyle } > { studyTime } </ Text >
67
+ < Text
68
+ className = { textCellStyle }
69
+ style = { { width : "11rem" , textAlign : "center" } }
70
+ >
71
+ { studyTime }
72
+ </ Text >
60
73
< Text className = { textCellStyle } > { totalWeek } 주 코스</ Text >
61
74
< Flex direction = "column" textAlign = "center" >
62
75
< Text className = { textCellStyle } >
0 commit comments