diff --git a/components/home/review/reviewSwiper/index.tsx b/components/home/review/reviewSwiper/index.tsx index 65b68d0b..b766dc02 100644 --- a/components/home/review/reviewSwiper/index.tsx +++ b/components/home/review/reviewSwiper/index.tsx @@ -13,11 +13,11 @@ const ReviewSwiper = () => { if (isLoading) return ; return ( - {data?.list.map((item: ReviewItemType) => { + {data?.list.map((item: ReviewItemType, index: number) => { return ( - + { const setIsProduct = useSetRecoilState(isProductState); @@ -34,6 +35,25 @@ const MItem = ({ item }: { item: MypageSellingType }) => { // 게시만료일때만 => 판매완료, 기한만료, 판매불가 따지기 const isNothing = item?.dealState ? true : false; + const renderDealState = (dealState: string) => { + switch (dealState) { + case 'EXPIRED': + return ( + <> +

{getSellState(dealState)}

+ + + ); + case 'DONEDEAL': + return

판매일 : {getDotDate(item.endDate, true, true, true)}

; + case 'UNSOLD': + case 'UNABLESELL': + return

{getSellState(dealState)}

; + default: + return

게시만료일 ~ {getDotDate(item.endDate, true, true, true)}

; + } + }; + return (
@@ -67,6 +87,7 @@ const MItem = ({ item }: { item: MypageSellingType }) => { 캐치특가 )} + s
{/* 호텔 이름과 가격 정보 */}
@@ -93,16 +114,12 @@ const MItem = ({ item }: { item: MypageSellingType }) => {
-

{getSellState(item.dealState as string)}

- + {renderDealState(item.dealState as string)}
- {item && item.dealState && ( + {item && item.dealState === 'DONEDEAL' && ( { {data ? ( data.pages.map((page, pageIndex) => (
- {page.list.map((item: ReviewItemType) => ( + {page.list.map((item: ReviewItemType, index: number) => ( { export const getSellState = (state: string) => { switch (state) { case 'EXPIRED': - return '기한 만료'; + return '게시 기한 만료'; case 'UNSOLD': return '체크인 만료'; case 'UNABLESELL':