/* eslint-disable @next/next/no-img-element */ import Image from "next/image"; import { type PropsWithChildren } from "react"; import { Badge } from "@/components/ui/badge/badge"; import Card from "@/components/ui/card/card"; import type { LIconProps } from "@/components/ui/lucid-icon/lucid-icon"; import LIcon from "@/components/ui/lucid-icon/lucid-icon"; import { useLocale } from "@/hooks/useLocale"; import { cn } from "@/libs/utils"; import DefautlImage from "@/public/assets/images/defaultImage.jpg"; import type { Addons } from "@/services/eva-display/hotel/hotel-detail/hotel-detail-services.types"; export interface RezervationSummaryProps extends PropsWithChildren { className?: string; } interface RezervationSummaryTitleProps extends PropsWithChildren { title: string; } interface RezervationSummaryRoomInfoProps extends PropsWithChildren { hotelName: string; } interface RezervationSummaryRoomPropertyProps extends PropsWithChildren { icon: LIconProps; } interface HotelRezervationSummaryDateInfoProps { startDate: string; startTime?: string; endDate: string; endTime?: string; nightlyRateDescription: string; } interface HotelDiscountPriceProps { price: string; title: string; } interface HotelRezervationSummaryProps extends PropsWithChildren { image: string; hotelName: string; hotelLocation?: string; } interface HotelRezervationSummaryRoomInfoProps extends PropsWithChildren { title: string; passengerDescription: string; mealDescription: string; addons?: Addons[]; } interface HotelPriceProps { nightlyRateDescription: string; discount: boolean; discountDescription?: string; price: string; } interface RezervationSummaryTotalPriceProps { price: string; } interface PriceDescription { description: string; price: string; } interface RezervationSummaryFlightPriceProps { priceDescription: PriceDescription[]; } interface RezervationSummaryFlightInfoProps extends PropsWithChildren { destination: string; origin: string; date: string; time: string; flightTime: string; operatingAirline: string; flightNumber: string; } const RezervationSummaryProvider = ({ children, className, }: RezervationSummaryProps) => { return ( {children} ); }; const RezervationSummaryTitle = ({ title, children, }: RezervationSummaryTitleProps) => { return (

{title}

{children}
); }; const RezervationSummaryDivider = () => { return
; }; const RezervationSummaryRoomInfo = ({ hotelName, children, }: RezervationSummaryRoomInfoProps) => { return (

{hotelName}

{children}
); }; const RezervationSummaryRoomProperty = ({ children, icon, }: RezervationSummaryRoomPropertyProps) => { return (
{children}
); }; const RezervationSummaryTotalPrice = ({ price, }: RezervationSummaryTotalPriceProps) => { const { t } = useLocale(); return (
{`${t("Total")} ${t("Amount")}`} {price}
); }; const HotelCurrencyTotalPrice = ({ price, }: RezervationSummaryTotalPriceProps) => { return (
Otel Para Birimi (₺) {price}
); }; const RezervationSummaryTotalPriceMobile = ({ price, }: RezervationSummaryTotalPriceProps) => { const { t } = useLocale(); return (
{t("Total")} {price}
); }; const HotelRezervationSummaryDateInfo = ({ startDate, startTime, endDate, endTime, nightlyRateDescription, }: HotelRezervationSummaryDateInfoProps) => { const { t } = useLocale(); return (
{t("Check-in")}:
{startDate} {startTime && ( ({startTime}) )}
{t("Check-out")}:
{endDate} {endTime && ( ({endTime}) )}
{t("Number of Nights")} {nightlyRateDescription}
); }; const HotelRezervationSummary = ({ image, hotelName, hotelLocation, children, }: HotelRezervationSummaryProps) => { const imgURL = !image ? DefautlImage : image; return (
{hotelName} {hotelLocation && ( {hotelLocation} )}
{children}
); }; const HotelRezervationSummaryRoomInfo = ({ title, passengerDescription, mealDescription, children, addons, }: HotelRezervationSummaryRoomInfoProps) => { return (
{title} {passengerDescription} {addons?.map((addon) => ( {addon.description} ))} {mealDescription} {children}
); }; const HotelPrice = ({ nightlyRateDescription, discount, discountDescription, price, }: HotelPriceProps) => { return (
{nightlyRateDescription}
{discount && discountDescription ? ( <> {discountDescription} {price} ) : (
{price}
)}
); }; const HotelDiscountPrice = ({ price, }: Omit) => { const { t } = useLocale(); return (
{t("Discounted Price")} {price}
); }; const EarlyBookingDiscount = ({ price, title }: HotelDiscountPriceProps) => { return (
{title} - {price}
); }; const RezervationSummaryFlightInfo = ({ destination, origin, date, time, flightTime, operatingAirline, flightNumber, children, }: RezervationSummaryFlightInfoProps) => { return (
{origin} {destination}
{children}
{`${date} / ${time} (${flightTime})`}
{`${operatingAirline} - ${flightNumber}`}
); }; const RezervationSummaryFlightPriceDescription = ({ description, price, }: PriceDescription) => { return (
{description} {price}
); }; const RezervationSummaryFlightPrice = ({ priceDescription, }: RezervationSummaryFlightPriceProps) => { return (

Fiyat Özeti

{priceDescription.map((item, index) => ( ))}
); }; const RezervationSummaryFlightTotalPrice = ({ price, }: RezervationSummaryTotalPriceProps) => { const { t } = useLocale(); return (
{`${t("Total")} ${t( "Amount", )}`} {price}
); }; interface ReservationSummaryAdditionalServiceProps { title: string; itemName: string; itemNameExtra?: string; price: string; minusOrPlus: "-" | "+"; } const ReservationSummaryAdditionalService = ({ title, itemName, itemNameExtra, price, minusOrPlus, }: ReservationSummaryAdditionalServiceProps) => { return (
{title}
{itemName} {itemNameExtra && ( {itemNameExtra} )} {minusOrPlus + price}
); }; export { EarlyBookingDiscount, HotelCurrencyTotalPrice, HotelDiscountPrice, HotelPrice, HotelRezervationSummary, HotelRezervationSummaryDateInfo, HotelRezervationSummaryRoomInfo, ReservationSummaryAdditionalService, RezervationSummaryDivider, RezervationSummaryFlightInfo, RezervationSummaryFlightPrice, RezervationSummaryFlightTotalPrice, RezervationSummaryProvider, RezervationSummaryRoomInfo, RezervationSummaryRoomProperty, RezervationSummaryTitle, RezervationSummaryTotalPrice, RezervationSummaryTotalPriceMobile, };