--- import Base from '../../layouts/Base.astro'; import PageHero from '../../components/PageHero.astro'; import type { ImageMetadata } from 'astro'; import { services, getService } from '../../data/services'; import { performanceClassPricing } from '../../data/pricing'; import { serviceIcons } from '../../data/service-icons'; import T from '../../components/content/T.astro'; import TImg from '../../components/content/TImg.astro'; import CalendarioModal from '../../components/CalendarioModal.astro'; import { calendariDaMostrare, PAGINE_CON_CALENDARIO } from '../../data/calendari'; import { t } from '../../lib/content'; export const prerender = false; const service = getService(Astro.params.slug!); // `page: false` = servizio senza scheda (oggi la Performance Class, che non si eroga più): // la voce esiste ancora nei dati per la card in griglia, ma la pagina non c'è. if (!service || service.page === false) return new Response(null, { status: 404 }); const slug = service.slug; // Il calendario della sala si apre dalle pagine delle class. La voce compare solo se c'è // davvero una griglia da mostrare (in vigore o prossima): un link che apre un popup vuoto è // peggio di nessun link. const conCalendario = PAGINE_CON_CALENDARIO.includes(slug) && calendariDaMostrare(new Date()).length > 0; const others = services.filter((p) => p.slug !== service.slug && p.grid !== false && p.page !== false); const images = import.meta.glob<{ default: ImageMetadata }>('../../assets/img/program-*.jpg', { eager: true }); const imgOf = (slug: string) => Object.entries(images).find(([p]) => p.includes(`program-${slug}.`))?.[1]?.default; const heroImg = imgOf(service.slug); // Categorie come da Figma (Performance class.pdf), non quelle del blog → tag service.side.category.1-4 const categoryIndexes = [1, 2, 3, 4]; // Ordine card pricing come da Figma: tan, taupe, dark const tones = ['tan', 'taupe', 'dark']; ---

{t(`service.${slug}.title`).toUpperCase()}

{service.features.length > 0 && (
    {service.features.map((_, i) => )}
)} {heroImg && ( )} {service.extra && (
    {service.extra.items.map((_, i) => )}
)}
{service.faq.map((_, i) => (
))}
{service.hasPricing && (
{performanceClassPricing.groups.map((g, gi) => (
{g.open ? '+' : '–'} {g.plans.length === 0 ? ( ) : (
{g.plans.map((p, i) => (

{p.monthly}€

{p.entries} {p.entries === 1 ? t('service.pricing.entries-singular') : t('service.pricing.entries-plural')}

{t('service.pricing.buy-cta')}
))}
)}
))}
)} {conCalendario && }