fix(SW-2853): tracking for breakfast ancillaries * fix(SW-2853): tracking for breakfast ancillaries * fix(SW-2853): viewAncillary event fix for breakfast * fix(SW-2853): pr comment spread room facilities Approved-by: Tobias Johansson
33 lines
920 B
TypeScript
33 lines
920 B
TypeScript
import { useAddAncillaryStore } from "@/stores/my-stay/add-ancillary-flow"
|
|
|
|
import { AncillaryCard } from "@/components/TempDesignSystem/AncillaryCard"
|
|
import { trackViewAncillary } from "@/utils/tracking/myStay"
|
|
|
|
import type { SelectedAncillary } from "@/types/components/myPages/myStay/ancillaries"
|
|
|
|
interface WrappedAncillaryProps {
|
|
ancillary: SelectedAncillary
|
|
}
|
|
|
|
export default function WrappedAncillaryCard({
|
|
ancillary,
|
|
}: WrappedAncillaryProps) {
|
|
const { description, ...ancillaryWithoutDescription } = ancillary
|
|
const { selectAncillary, booking } = useAddAncillaryStore((state) => ({
|
|
selectAncillary: state.selectAncillary,
|
|
booking: state.booking,
|
|
}))
|
|
|
|
return (
|
|
<div
|
|
role="button"
|
|
onClick={() => {
|
|
selectAncillary(ancillary)
|
|
trackViewAncillary(ancillary, booking)
|
|
}}
|
|
>
|
|
<AncillaryCard ancillary={ancillaryWithoutDescription} />
|
|
</div>
|
|
)
|
|
}
|