From 876d08a421991d46240e7d8b7e356bbf6115b0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Thu, 14 Aug 2025 12:19:03 +0000 Subject: [PATCH] Merged in feat/SW-3229-filter-map-pois (pull request #2644) feat(SW-3229): filter map card pois * feat(SW-3229): filter map card pois Approved-by: Erik Tiekstra --- .../ContentType/HotelPage/index.tsx | 6 +++++- .../components/ContentType/HotelPage/utils.ts | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/scandic-web/components/ContentType/HotelPage/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/index.tsx index b7f849203..32e465fe3 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/index.tsx @@ -41,6 +41,7 @@ import { Rooms } from "./Rooms" import SidePeeks from "./SidePeeks" import TabNavigation from "./TabNavigation" import { + getFilteredSlicedPois, getPageSectionsData, getTrackingHotelData, getTrackingPageData, @@ -230,7 +231,10 @@ export default async function HotelPage({ hotelId }: HotelPageProps) { hotelName={name} markerInfo={{ hotelType, hotelId }} /> - + diff --git a/apps/scandic-web/components/ContentType/HotelPage/utils.ts b/apps/scandic-web/components/ContentType/HotelPage/utils.ts index 9d3187aa2..1c1052d73 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/utils.ts +++ b/apps/scandic-web/components/ContentType/HotelPage/utils.ts @@ -1,7 +1,12 @@ import { logger } from "@scandic-hotels/common/logger" +import { PointOfInterestGroupEnum } from "@scandic-hotels/trpc/enums/pointOfInterest" import type { Lang } from "@scandic-hotels/common/constants/language" -import type { Hotel, HotelData } from "@scandic-hotels/trpc/types/hotel" +import type { + Hotel, + HotelData, + PointOfInterest, +} from "@scandic-hotels/trpc/types/hotel" import type { HotelPage } from "@scandic-hotels/trpc/types/hotelPage" import type { IntlShape } from "react-intl" @@ -186,3 +191,15 @@ export function getPageSectionsData( return sections } + +export function getFilteredSlicedPois(pois: PointOfInterest[]) { + return pois + .filter( + (poi) => + poi.categoryName === PointOfInterestGroupEnum.ATTRACTIONS || + poi.categoryName === PointOfInterestGroupEnum.LOCATION || + poi.categoryName === PointOfInterestGroupEnum.SHOPPING_DINING || + poi.categoryName === PointOfInterestGroupEnum.PUBLIC_TRANSPORT + ) + .slice(0, 3) +}