qudoco-fe/app/page.tsx

71 lines
2.3 KiB
TypeScript
Raw Normal View History

import type { Metadata } from "next";
2026-02-17 09:05:22 +00:00
import Header from "@/components/landing-page/headers";
import AboutSection from "@/components/landing-page/about";
import ProductSection from "@/components/landing-page/product";
import ServiceSection from "@/components/landing-page/service";
import Technology from "@/components/landing-page/technology";
import Footer from "@/components/landing-page/footer";
2026-04-10 07:21:29 +00:00
import PopupNewsBanner from "@/components/landing-page/popup-news";
import { publicFetch } from "@/lib/public-api";
import type {
CmsAboutContent,
CmsHeroContent,
CmsPartnerContent,
CmsPopupContent,
CmsProductContent,
CmsServiceContent,
} from "@/types/cms-landing";
const landingDescription =
"Jelajahi layanan, produk, dan informasi terbaru dari Qudoco — satu portal untuk konten profesional dan komunikasi yang jelas.";
export const metadata: Metadata = {
title: "Beranda",
description: landingDescription,
openGraph: {
title: "Beranda | Qudoco",
description: landingDescription,
url: "/",
},
alternates: {
canonical: "/",
},
};
2026-04-10 07:21:29 +00:00
export default async function Home() {
const [hero, aboutList, productList, serviceList, partners, popupList] =
await Promise.all([
publicFetch<CmsHeroContent | null>("/hero-contents"),
publicFetch<CmsAboutContent[]>("/about-us-contents"),
publicFetch<CmsProductContent[] | CmsProductContent>("/our-product-contents"),
publicFetch<CmsServiceContent[] | CmsServiceContent>("/our-service-contents"),
publicFetch<CmsPartnerContent[]>("/partner-contents"),
publicFetch<CmsPopupContent[]>("/popup-news-contents?page=1&limit=20"),
]);
const about = aboutList?.[0] ?? null;
const products = Array.isArray(productList)
? productList
: productList
? [productList]
: [];
const services = Array.isArray(serviceList)
? serviceList
: serviceList
? [serviceList]
: [];
const popups = Array.isArray(popupList) ? popupList : [];
2026-02-17 09:05:22 +00:00
return (
<div className="relative min-h-screen bg-white font-[family-name:var(--font-geist-sans)]">
2026-04-10 07:21:29 +00:00
<PopupNewsBanner popups={popups} />
<Header hero={hero} />
<AboutSection about={about} />
<ProductSection products={products} />
<ServiceSection services={services} />
<Technology partners={partners ?? []} />
2026-02-17 09:05:22 +00:00
<Footer />
</div>
);
}