trackion of date index searching

This commit is contained in:
2025-11-22 22:07:20 +01:00
parent 2ae027dba2
commit 1c6bca9f52
4 changed files with 9 additions and 961 deletions

View File

@@ -24,19 +24,20 @@ interface Flight {
fareRule: FareRule;
refundable: boolean;
basePrice: number;
dateIndex?: number;
}
export default function AirlineCard({ flight }: { flight: Flight }) {
const durationRef = useHoverTracking({
eventName: 'hover_over_title',
productId: flight.id,
metadata: { elementText: flight.duration },
metadata: { elementText: flight.duration, dateIndex: flight.dateIndex },
});
const priceRef = useHoverTracking({
eventName: 'hover_over_paragraph',
productId: flight.id,
metadata: { elementText: 'price' },
metadata: { elementText: 'price', dateIndex: flight.dateIndex },
});
const handleCardClick = () => {
@@ -44,6 +45,7 @@ export default function AirlineCard({ flight }: { flight: Flight }) {
cabinClass: flight.cabinClass,
fareRule: flight.fareRule,
price: flight.basePrice,
dateIndex: flight.dateIndex,
});
};

View File

@@ -39,13 +39,13 @@ export default function HotelCard({ hotel }: { hotel: Hotel }) {
const titleRef = useHoverTracking({
eventName: 'hover_over_title',
productId: hotel.id,
metadata: { elementText: hotel.name },
metadata: { elementText: hotel.name, dateIndex: hotel.dateIndex },
});
const priceRef = useHoverTracking({
eventName: 'hover_over_paragraph',
productId: hotel.id,
metadata: { elementText: 'price' },
metadata: { elementText: 'price', dateIndex: hotel.dateIndex },
});
const handleCardClick = () => {
@@ -53,6 +53,7 @@ export default function HotelCard({ hotel }: { hotel: Hotel }) {
roomType: hotel.roomType,
price: hotel.pricePerNight,
nights: hotel.nights,
dateIndex: hotel.dateIndex,
});
};

View File

@@ -19,6 +19,7 @@ export interface Hotel {
roomType: string;
checkIn: string;
checkOut: string;
dateIndex: number;
amenities: string[];
refundable: boolean;
pricePerNight: number;
@@ -39,6 +40,7 @@ export const transformProduct = (p: HotelProduct): Hotel => {
roomType: room_type,
checkIn: checkIn.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }),
checkOut: checkOut.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }),
dateIndex: date_index,
amenities: metadata?.amenities || [],
refundable: metadata?.refundable || false,
pricePerNight: metadata?.base_price || 100,