diff --git a/src/components/dateCourse/info.tsx b/src/components/dateCourse/info.tsx index f617b9b..6ebf330 100644 --- a/src/components/dateCourse/info.tsx +++ b/src/components/dateCourse/info.tsx @@ -16,30 +16,41 @@ type TMealKey = keyof typeof Meal; const isBudgetKey = (v: string): v is TBudgetKey => Object.prototype.hasOwnProperty.call(Budget, v); const isTotalTimeKey = (v: string): v is TTotalTimeKey => Object.prototype.hasOwnProperty.call(TotalTime, v); const isMealKey = (v: string): v is TMealKey => Object.prototype.hasOwnProperty.call(Meal, v); + export default function Info({ cashTag, locationTag, timeTag, MealTag, keywordTags }: TInfo) { - const label = isBudgetKey(cashTag) ? Budget[cashTag] : '알 수 없음'; - const totalTime = isTotalTimeKey(timeTag) ? TotalTime[timeTag] : '알 수 없음'; - const meals = MealTag.filter(isMealKey).map((tag) => Meal[tag]); + const label = cashTag != null && isBudgetKey(cashTag) ? Budget[cashTag] : '알 수 없음'; + const totalTime = timeTag != null && isTotalTimeKey(timeTag) ? TotalTime[timeTag] : '알 수 없음'; + const meals = MealTag !== null && MealTag.filter(isMealKey).map((tag) => Meal[tag]); return (
- - - - - - - - - - - - - - - - - + {cashTag && ( + + + + )} + {locationTag && ( + + + + )} + {timeTag && ( + + + + )} + + {meals && ( + + + + )} + + {keywordTags && ( + + + + )}
); } diff --git a/src/components/dateCourse/timeline.tsx b/src/components/dateCourse/timeline.tsx index 29d989e..7e88b42 100644 --- a/src/components/dateCourse/timeline.tsx +++ b/src/components/dateCourse/timeline.tsx @@ -12,6 +12,9 @@ import Location from '@/assets/icons/Location_Blank.svg?react'; function Timeline({ end = false, image, name, placeCategoryResponseList, roadNameAddress, averagePrice, time, signatureDish }: TTimeline) { const [open, setOpen] = useState(false); + const editTime = time != null ? time.split(':')[0] : '00'; + const editMin = time != null ? time.split(':')[1] : '00'; + return (
(end ? undefined : setOpen(!open))} >
- {time.split(':')[0]}:{time.split(':')[1]} + {editTime}:{editMin}