feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
import type { Facility } from "@/types/components/hotelPage/facilities"
|
||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
||||
|
||||
type ActivityCard = {
|
||||
background_image?: ImageVaultAsset
|
||||
scripted_title?: string
|
||||
heading: string
|
||||
body_text: string
|
||||
cta_text: string
|
||||
contentPage: Array<{ href: string }>
|
||||
}
|
||||
import type { ActivityCard } from "@/types/trpc/routers/contentstack/hotelPage"
|
||||
|
||||
export function setActivityCard(activitiesCard: ActivityCard): Facility {
|
||||
const hasImage = activitiesCard.background_image
|
||||
const hasImage = !!activitiesCard.background_image
|
||||
return [
|
||||
{
|
||||
id: "activities",
|
||||
@@ -22,7 +13,7 @@ export function setActivityCard(activitiesCard: ActivityCard): Facility {
|
||||
backgroundImage: hasImage ? activitiesCard.background_image : undefined,
|
||||
primaryButton: hasImage
|
||||
? {
|
||||
href: activitiesCard.contentPage[0].href,
|
||||
href: activitiesCard.contentPage.href,
|
||||
title: activitiesCard.cta_text,
|
||||
isExternal: false,
|
||||
}
|
||||
@@ -30,7 +21,7 @@ export function setActivityCard(activitiesCard: ActivityCard): Facility {
|
||||
secondaryButton: hasImage
|
||||
? undefined
|
||||
: {
|
||||
href: activitiesCard.contentPage[0].href,
|
||||
href: activitiesCard.contentPage.href,
|
||||
title: activitiesCard.cta_text,
|
||||
isExternal: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user