fix(groups): connect amenities array to CMS — was hardcoded, now reads label+image from global

This commit is contained in:
Vadym Samoilenko 2026-06-03 14:49:38 +01:00
parent a2fb01ea11
commit 69675851f8

View file

@ -73,39 +73,50 @@ export default async function GroupVisitsPage() {
const featureB = featureImages[1] ?? FIGMA.featureB
const amenitiesTitle = (d?.amenitiesTitle as string) ?? 'Ми подбали про затишок і комфорт'
// TODO: move amenity labels/images to CMS
const amenities: { label: React.ReactNode; imageUrl: string | null }[] = [
{
label: (
<>
2 локації
<br />
без обмежень у часі
</>
),
imageUrl: FIGMA.amenity1,
},
{
label: (
<>
Вбиральня та кафе
<br />
на території
</>
),
imageUrl: FIGMA.amenity2,
},
{ label: 'Укриття поруч', imageUrl: FIGMA.amenity3 },
{
label: (
<>
Огороджено забором,
<br />є охорона
</>
),
imageUrl: FIGMA.amenity4,
},
]
interface AmenityRaw {
label?: string
image?: Media | number | null
}
const cmsAmenities = d?.amenities as AmenityRaw[] | undefined
const amenities: { label: React.ReactNode; imageUrl: string | null }[] =
cmsAmenities && cmsAmenities.length > 0
? cmsAmenities.map((a) => ({
label: a.label ?? '',
imageUrl: mediaUrl(a.image as Media | undefined),
}))
: [
{
label: (
<>
2 локації
<br />
без обмежень у часі
</>
),
imageUrl: FIGMA.amenity1,
},
{
label: (
<>
Вбиральня та кафе
<br />
на території
</>
),
imageUrl: FIGMA.amenity2,
},
{ label: 'Укриття поруч', imageUrl: FIGMA.amenity3 },
{
label: (
<>
Огороджено забором,
<br />є охорона
</>
),
imageUrl: FIGMA.amenity4,
},
]
const workingHoursTitle = (d?.workingHoursTitle as string) ?? 'Час роботи'
const workingHours = (d?.workingHours as string) ?? 'пʼятниця-субота-неділя з 11:00 до 20:00'