// This one is no longer used, use sidebar in shared folder. temp kept for reference. // import { BookingPackageFlightMetaData, BookingPackageRoom, BookingPriceDetail } from '@qite/tide-client/build/types'; // import { ServiceType } from '@qite/tide-client'; // import { compact, isEmpty } from 'lodash'; // import React, { useState } from 'react'; // import { useSelector } from 'react-redux'; // import { buildClassName } from '../../../shared/utils/class-util'; // import { formatPrice } from '../../../shared/utils/localization-util'; // import { selectAgentAdressId, selectCurrencyCode } from '../booking/selectors'; // import SidebarFlight from './sidebar-flight'; // import { getDatePeriodText, getPaxTypeTranslation } from './sidebar-util'; // import { PricePerPaxType } from '../../types'; // import ProductCard from '../../../shared/booking/product-card'; // interface SidebarProps { // productName: string; // thumbnailUrl?: string; // isLoading: boolean; // travelerRooms?: string[]; // startDateText?: string; // endDateText?: string; // departureFlightMetaData?: BookingPackageFlightMetaData; // returnFlightMetaData?: BookingPackageFlightMetaData; // basePrice?: number; // commission?: number; // totalPrice?: number; // remainingAmountText?: string; // includedCosts?: BookingPriceDetail[]; // extraCosts?: BookingPriceDetail[]; // deposit?: number; // accommodations?: BookingPackageRoom[]; // includedServiceTypes?: number[]; // isOnRequest?: boolean; // headerComponent?: JSX.Element; // footerComponent?: JSX.Element; // loaderComponent?: JSX.Element; // isUnavailable?: boolean; // basePricePerPaxType?: PricePerPaxType[]; // seperateExtraPricePerPaxType?: PricePerPaxType[]; // translations: any; // agent?: number; // } // const Sidebar: React.FC = ({ // productName, // thumbnailUrl, // isLoading, // travelerRooms, // startDateText, // endDateText, // departureFlightMetaData, // returnFlightMetaData, // basePrice, // commission, // totalPrice, // includedCosts, // extraCosts, // deposit, // accommodations, // includedServiceTypes, // isOnRequest, // headerComponent, // footerComponent, // loaderComponent, // isUnavailable, // basePricePerPaxType, // seperateExtraPricePerPaxType, // translations, // agent // }) => { // const [active, setActive] = useState(false); // const currencyCode = useSelector(selectCurrencyCode); // const canShowPriceBreakdownSection = Boolean(basePrice && basePrice > 0) || !isEmpty(includedCosts) || !isEmpty(extraCosts); // const canShowTotalPriceSection = Boolean(totalPrice && totalPrice > 0); // const remainingAmount = Number(((totalPrice ?? 0) - (deposit ?? 0)).toFixed(2)); // const isFlightOnly = includedServiceTypes?.length === 1 && includedServiceTypes.includes(ServiceType.flight); // const handleToggleClick = () => { // setActive(!active); // }; // return ( //
// {headerComponent} //
// //
// {!isUnavailable ? ( //
//
//
//
{translations.SIDEBAR.TRAVEL_INFO}
// {!isEmpty(travelerRooms) && // travelerRooms?.map((room, rIndex) => ( //
//
// {travelerRooms.length > 1 && `${translations.SHARED.ROOM} ${rIndex + 1}`} // {travelerRooms.length === 1 && translations.ROOM_OPTIONS_FORM.TRAVELER_GROUP} //
//
{room}
//
// ))} // {startDateText && ( //
//
// {startDateText && endDateText ? translations.SIDEBAR.DEPARTURE : translations.SIDEBAR.DEPARTURE_SINGLE} //
//
{startDateText}
//
// )} // {endDateText && ( //
//
{translations.SIDEBAR.ARRIVAL}
//
{endDateText}
//
// )} //
// {isLoading && loaderComponent} // {!isLoading && departureFlightMetaData && ( // // )} // {!isLoading && returnFlightMetaData && ( // // )} // {accommodations && ( //
//
{translations.SIDEBAR.ACCOMMODATION}
// {accommodations.map((accommodation) => { // let option = accommodation.options.find((x) => x.isSelected); // return ( //
//
//
// {option?.accommodationName} // {isOnRequest ? ` (${translations.SIDEBAR.ON_REQUEST})` : ''} // {option?.isOnRequest ? ` (${translations.SIDEBAR.ON_REQUEST})` : ''} //
// {/*
// {option && option.price > 0 && formatPrice(option?.price)} //
*/} //
//
//
{option?.regimeName}
//
{!isFlightOnly && getDatePeriodText(translations, option?.from, option?.to, true)}
//
//
// ); // })} //
// )} //
// {!isLoading && canShowPriceBreakdownSection && ( //
// {basePrice !== undefined && basePrice > 0 && ( //
//
//
//
{translations.SIDEBAR.BASE_PRICE}
//
//
{formatPrice(basePrice, currencyCode)}
//
// {basePricePerPaxType && // basePricePerPaxType.map((ppt, index) => ( // //
//
// {ppt.numberOfPax} {getPaxTypeTranslation(translations, ppt.paxType, ppt.numberOfPax)} //
//
{formatPrice(ppt.pricePerPaxType, currencyCode)}
//
// {ppt.details.map((detail, dIndex) => ( //
//
// {detail.numberOfPax}x {detail.description} //
//
{formatPrice(detail.price / detail.numberOfPax, currencyCode)}
//
// ))} //
// ))} //
// )} // {!isEmpty(includedCosts) && ( //
//
{translations.SIDEBAR.INCLUDED_COSTS}
// {includedCosts?.map((priceDetail, index) => ( // //
//
{priceDetail.productName}
// {priceDetail.showPrice && ( //
{formatPrice(priceDetail.price * priceDetail.amount, currencyCode)}
// )} //
//
//
{priceDetail.accommodationName ?? priceDetail.accommodationCode}
//
//
// ))} //
// )} // {!isEmpty(extraCosts) && ( //
//
{translations.SIDEBAR.EXTRA_COSTS}
// {extraCosts?.map((priceDetail, index) => ( // //
//
{priceDetail.productName}
// {priceDetail.showPrice && ( //
{formatPrice(priceDetail.price * priceDetail.amount, currencyCode)}
// )} //
//
//
{priceDetail.accommodationName ?? priceDetail.accommodationCode}
//
// {seperateExtraPricePerPaxType && // seperateExtraPricePerPaxType.map((ppt, index) => ( // //
//
// {ppt.numberOfPax} {getPaxTypeTranslation(translations, ppt.paxType, ppt.numberOfPax)} //
//
{formatPrice(ppt.pricePerPaxType, currencyCode)}
//
// {ppt.details.map((detail, dIndex) => ( //
//
// {detail.numberOfPax}x {detail.description} //
//
{formatPrice(detail.price / detail.numberOfPax, currencyCode)}
//
// ))} //
// ))} //
// ))} //
// )} //
// )} //
// ) : ( //
//
{translations.SIDEBAR.PACKAGE_NOT_AVAILABLE}
//
// )} // {!isLoading && canShowTotalPriceSection && !isUnavailable && ( //
// {deposit && remainingAmount > 0 ? ( //
// {agent && ( //
//
//
{translations.SIDEBAR.COMMISSION}
//
//
//
//
{formatPrice(commission ?? 0, currencyCode)}
//
//
//
// )} // {totalPrice !== undefined && totalPrice > 0 && ( //
//
//
{translations.SHARED.TOTAL_PRICE}
//
//
//
//
{formatPrice(totalPrice, currencyCode)}
//
//
//
// )} //
//
//
{translations.SIDEBAR.DEPOSIT}
//
//
//
//
{formatPrice(deposit, currencyCode)}
//
//
//
//
// // // {translations.SIDEBAR.DEPOSIT_TEXT1} // {translations.SIDEBAR.DEPOSIT_TEXT2} // {translations.SIDEBAR.DEPOSIT_TEXT3} // {formatPrice(remainingAmount, currencyCode)} // {translations.SIDEBAR.DEPOSIT_TEXT4} // {translations.SIDEBAR.DEPOSIT_TEXT5} // {translations.SIDEBAR.DEPOSIT_TEXT6} // // //
//
// ) : ( //
// {agent && ( //
//
//
{translations.SIDEBAR.COMMISSION}
//
//
//
//
{formatPrice(commission ?? 0, currencyCode)}
//
//
//
// )} // {totalPrice !== undefined && totalPrice > 0 && ( //
//
//
{translations.SHARED.TOTAL_PRICE}
//
//
//
//
{formatPrice(totalPrice, currencyCode)}
//
//
//
// )} //
// )} //
// )} // {footerComponent} //
//
//
// ); // }; // export default Sidebar;