11import  {  Box ,  Flex ,  Heading ,  Text  }  from  "@/components/common" ; 
2+ import  {  format  }  from  "date-fns" ; 
3+ 
4+ import  {  getTeamScheduleStatus  }  from  "@/utils/getTeamScheduleStatus" ; 
25
36import  type  {  TeamScheduleType  }  from  "@/types/schedule" ; 
47
@@ -11,19 +14,23 @@ import {
1114}  from  "@/components/Team/TeamSchedule/TeamScheduleCard/TeamScheduleCard.style" ; 
1215
1316const  TeamScheduleCard  =  ( {  teamScheduleData } : {  teamScheduleData : TeamScheduleType  } )  =>  { 
14- 	const  {  teamColor,  title,  startDate,  endDate,  status =  true  }  =  teamScheduleData ; 
17+ 	const  {  teamColor,  title,  startDate,  endDate,  status }  =  teamScheduleData ; 
18+ 	const  scheduleStatusString  =  getTeamScheduleStatus ( status ) ; 
19+ 
1520	return  ( 
1621		< Box  css = { teamScheduleCardBoxStyle } > 
1722			< Flex  css = { teamScheduleCardHeaderBoxStyle } > 
1823				< Heading  style = { {  textOverflow : "ellipsis"  } }  size = "xSmall" > 
1924					{ title } 
2025				</ Heading > 
21- 				< Flex  css = { teamScheduleCardStatusBoxStyle ( true ) } > { status  ? "진행중"  : "마감" } </ Flex > 
26+ 				< Flex  css = { teamScheduleCardStatusBoxStyle ( status  !==  "CLOSING" ) } > 
27+ 					{ scheduleStatusString } 
28+ 				</ Flex > 
2229			</ Flex > 
23- 			< Text > { startDate }  ~ </ Text > 
24- 			< Text > { endDate } </ Text > 
30+ 			< Text > { format ( startDate ,   "yyyy년 M월 dd일 a HH:mm" ) } </ Text > 
31+ 			< Text > { format ( endDate ,   "yyyy년 M월 dd일 a HH:mm" ) } </ Text > 
2532			< Flex  style = { {  alignItems : "center" ,  justifyContent : "space-between"  } } > 
26- 				{ status  &&  ( 
33+ 				{ status  !==   "CLOSING"   &&  ( 
2734					< > 
2835						< Flex  style = { {  alignItems : "center"  } } > 
2936							겹치는 일정 < Text  css = { teamScheduleOverlapCount ( teamColor ) } > 0</ Text > 
0 commit comments