diff --git a/src/components/CarCardH.tsx b/src/components/CarCardH.tsx new file mode 100644 index 0000000..b5ebe03 --- /dev/null +++ b/src/components/CarCardH.tsx @@ -0,0 +1,139 @@ +import React, { FC } from "react"; +import { DEMO_CAR_LISTINGS } from "@/data/listings"; +import { CarDataType } from "@/data/types"; +import StartRating from "@/components/StartRating"; +import BtnLikeIcon from "@/components/BtnLikeIcon"; +import SaleOffBadge from "@/components/SaleOffBadge"; +import Badge from "@/shared/Badge"; +import Avatar from "@/shared/Avatar"; +import Image from "next/image"; +import Link from "next/link"; + +export interface CarCardHProps { + className?: string; + data?: CarDataType; +} + +const DEMO_DATA: CarDataType = DEMO_CAR_LISTINGS[0]; + +const CarCardH: FC = ({ className = "", data = DEMO_DATA }) => { + const { + address, + title, + href, + like, + saleOff, + isAds, + price, + reviewStart, + reviewCount, + author, + featuredImage, + } = data; + + const renderSliderGallery = () => { + return ( +
+
+ +
+ + {saleOff && } +
+ ); + }; + + const renderContent = () => { + return ( +
+
+
+ {isAds && } +

+ {title} +

+
+
+ + · +
+ + + + {address} +
+
+
+
+ {/* SHOW MOBILE */} +
+ 4 seats + · + Auto gearbox + · + 4 seats +
+ {/* SHOW DESK */} +
+ {/* --- */} +
+ + + 4 seats + +
+ {/* --- */} +
+ + + Auto gearbox + +
+ {/* --- */} +
+ + + 2 bags + +
+
+ +
+
+
+ + + Car owner {" "} + {author.displayName} + +
+ + {price} + {` `} + + /day + + +
+
+ ); + }; + + return ( +
+ + {renderSliderGallery()} + {renderContent()} + +
+ ); +}; + +export default CarCardH;