diff --git a/src/components/StayCard2.tsx b/src/components/StayCard2.tsx new file mode 100644 index 0000000..e38ee94 --- /dev/null +++ b/src/components/StayCard2.tsx @@ -0,0 +1,125 @@ +import React, { FC } from "react"; +import GallerySlider from "@/components/GallerySlider"; +import { DEMO_STAY_LISTINGS } from "@/data/listings"; +import { StayDataType } from "@/data/types"; +import StartRating from "@/components/StartRating"; +import BtnLikeIcon from "@/components/BtnLikeIcon"; +import SaleOffBadge from "@/components/SaleOffBadge"; +import Badge from "@/shared/Badge"; +import Link from "next/link"; + +export interface StayCard2Props { + className?: string; + data?: StayDataType; + size?: "default" | "small"; +} + +const DEMO_DATA = DEMO_STAY_LISTINGS[0]; + +const StayCard2: FC = ({ + size = "default", + className = "", + data = DEMO_DATA, +}) => { + const { + galleryImgs, + listingCategory, + address, + title, + bedrooms, + href, + like, + saleOff, + isAds, + price, + reviewStart, + reviewCount, + id, + } = data; + + const renderSliderGallery = () => { + return ( +
+ + + {saleOff && } +
+ ); + }; + + const renderContent = () => { + return ( +
+
+ + {listingCategory.name} ยท {bedrooms} beds + +
+ {isAds && } +

+ {title} +

+
+
+ {size === "default" && ( + + + + + )} + {address} +
+
+
+
+ + {price} + {` `} + {size === "default" && ( + + /night + + )} + + {!!reviewStart && ( + + )} +
+
+ ); + }; + + return ( +
+ {renderSliderGallery()} + {renderContent()} +
+ ); +}; + +export default StayCard2;