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 (