Files
websitedev/proto/src/app/(frontend)/[locale]/layout.tsx
T
Do SikiandClaude Opus 5.5 1e0742a548
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
feat(cms): hosting plans page with lifecycle gate and net + VAT prices (MITHOME-130)
- Products collection (interim mirror of the PLATFM-14 catalogue contract):
  lifecycle status, product type, required whole-forint net price, yearly
  billing, service definition, per-product English gate
- HostingPlans global: page copy, comparison labels, VAT rate (27%)
- Gate: production shows only active plans, staging all but retired; with no
  showable plan the page is 404 and left out of the menu and the sitemap
- /hu/tarhely-csomagok <-> /en/hosting-plans via PAGE_SLUGS (hreflang,
  language switcher, CTA page picker)
- Seed migration 20260929_hosting_plans: mIT Start (14 900 Ft/yr, 5 mailboxes)
  and mIT Mid (23 900 Ft/yr) as drafts, English AI draft; idempotent
- Production SEO suite expects at least 12 sitemap URLs; new SMOKE-10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:36:44 +02:00

66 lines
2.5 KiB
TypeScript

import { notFound } from 'next/navigation'
import Header from '../../../components/Header'
import Footer from '../../../components/Footer'
import { isLocale, localePath, type Locale } from '@/lib/i18n'
import { getCommonContent, getHomeContent, hasHostingPlans } from '@/lib/payload-content'
import { siteConfig, getMainNavigation, getFooterNavigation, getFooterLegalLinks, getSiteDescription, getLanguageSwitcherLabel } from '@/config/site'
// WHY force-dynamic (MITHOME-97): ezek az oldalak a Payload Local API-t hívják
// (élő MongoDB-olvasás). generateStaticParams + SSG mellett a build időben
// sütött ki minden oldal, és a Payload adminban végzett publikálás csak egy
// teljes redeploy után jelent volna meg a publikus oldalon — ez pont az
// ellentéte az önkiszolgáló szerkesztés céljának, amiért a Payload-migráció
// történt. force-dynamic-kal minden kérés friss Payload-olvasást kap, és a
// Docker build sem függ többé egy build-idejű MongoDB-kapcsolattól.
export const dynamic = 'force-dynamic'
export default async function LocaleLayout({
children,
params,
}: {
children: React.ReactNode
params: Promise<{ locale: string }>
}) {
const { locale: rawLocale } = await params
if (!isLocale(rawLocale)) notFound()
const locale: Locale = rawLocale
const [common, home, hostingPlans] = await Promise.all([
getCommonContent(locale),
getHomeContent(locale),
hasHostingPlans(), // MITHOME-130: menu item only while the page has a plan
])
const isStaging = process.env.NEXT_PUBLIC_DEPLOY_ENV === 'staging'
return (
<>
{isStaging && (
<div className="bg-amber-400 px-4 py-2 text-center text-xs font-extrabold tracking-[0.18em] text-amber-950 sm:text-sm">
{common.staging.banner}
</div>
)}
<Header
nav={getMainNavigation(locale, { hostingPlans })}
homeHref={localePath(locale)}
a11y={common.a11y}
languageLabel={getLanguageSwitcherLabel(locale)}
/>
<main className="flex-1">
{children}
</main>
<Footer
nav={getFooterNavigation(locale)}
legalLinks={getFooterLegalLinks(locale)}
homeHref={localePath(locale)}
description={getSiteDescription(locale)}
contactEmail={siteConfig.contact.email}
footerAddress={common.footer.address}
footerCopyright={common.footer.copyright}
homeServices={home.services.items.map((item) => ({ id: item.id, title: item.title, icon: item.icon }))}
locale={locale}
/>
</>
)
}