diff --git a/src/components/SectionGridFeaturePlaces.tsx b/src/components/SectionGridFeaturePlaces.tsx new file mode 100644 index 0000000..6ad943e --- /dev/null +++ b/src/components/SectionGridFeaturePlaces.tsx @@ -0,0 +1,69 @@ +import React, { FC, ReactNode } from "react"; +import { DEMO_STAY_LISTINGS } from "@/data/listings"; +import { StayDataType } from "@/data/types"; +import ButtonPrimary from "@/shared/ButtonPrimary"; +import HeaderFilter from "./HeaderFilter"; +import StayCard from "./StayCard"; +import StayCard2 from "./StayCard2"; + +// OTHER DEMO WILL PASS PROPS +const DEMO_DATA: StayDataType[] = DEMO_STAY_LISTINGS.filter((_, i) => i < 8); + +// +export interface SectionGridFeaturePlacesProps { + stayListings?: StayDataType[]; + gridClass?: string; + heading?: ReactNode; + subHeading?: ReactNode; + headingIsCenter?: boolean; + tabs?: string[]; + cardType?: "card1" | "card2"; +} + +const SectionGridFeaturePlaces: FC = ({ + stayListings = DEMO_DATA, + gridClass = "", + heading = "Featured places to stay", + subHeading = "Popular places to stay that Chisfis recommends for you", + headingIsCenter, + tabs = ["New York", "Tokyo", "Paris", "London"], + cardType = "card2", +}) => { + const renderCard = (stay: StayDataType) => { + let CardName = StayCard; + switch (cardType) { + case "card1": + CardName = StayCard; + break; + case "card2": + CardName = StayCard2; + break; + + default: + CardName = StayCard; + } + + return ; + }; + + return ( +
+ +
+ {stayListings.map((stay) => renderCard(stay))} +
+
+ Show me more +
+
+ ); +}; + +export default SectionGridFeaturePlaces;