add service detail page

This commit is contained in:
Schneider Roland
2025-05-21 22:28:12 +02:00
committed by Roland Schneider
parent 4a0cf5762f
commit 22272e0a17
11 changed files with 118 additions and 30 deletions

View File

@@ -1,9 +1,12 @@
import React from "react";
import strapiApi from "@/api/strapi/strapi-api";
import {BlocksContent, BlocksRenderer} from "@strapi/blocks-react-renderer";
export default async function ServiceArticlePage({params}: {
params: { slug: string}
params: Promise<{ slug: string}>
} ) {
const servicesByName = await strapiApi.getServicePage(params.slug);
const {slug} = await params
const {footer= undefined, subscribeNow = undefined} = await strapiApi.getServicePage();
const servicesByName = await strapiApi.getService(slug);
// return (
// <>
// {header && description && <SubHeaderComponent header1={header} description={description} />}
@@ -17,10 +20,19 @@ export default async function ServiceArticlePage({params}: {
// <AosComponent />
// </>
// );
console.info("slug", params.slug);
console.info("slug", slug);
console.info("servicesByName", servicesByName);
const selectedService = servicesByName[0];
const article = selectedService.article;
console.info("article", article);
selectedService.article
return (
<div>hello world {params.slug}</div>
<>
<BlocksRenderer content={article as BlocksContent} />
{ subscribeNow && <SubscribeComponent config={subscribeNow} /> }
{ footer && <FooterComponent config={footer} /> }
</>
);
}