"use client";
import { localeStorageHelper } from "@/libs/helpers/locale-storage-helper";
import { useHotelAddToCartQuery } from "@/services/eva-display/hotel/hotel-add-to-cart/hotel-add-to-cart.services";
import HotelSummarySkeleton from "./components/hotel-summary-skeleton";
import HotelSummaryContent from "./hotel-summary-content";
interface HotelSummaryDataProps {
variables: {
searchId: string;
productKey: string;
};
}
export const HotelSummaryData = (props: HotelSummaryDataProps) => {
const hotelAddToCartQuery = useHotelAddToCartQuery({
HotelCartProductRequest: {
ProductKey: props.variables.productKey,
SearchId: props.variables.searchId,
},
});
const getTpData = () => {
const tpData = localeStorageHelper.get("travel-planner");
if (!tpData || !tpData.customer || !tpData.room) {
return null;
}
return tpData;
};
const tpData = getTpData();
if (!hotelAddToCartQuery.isSuccess || !hotelAddToCartQuery.data || !tpData) {
return ;
}
return (
);
};