add service detail page
This commit is contained in:
committed by
Roland Schneider
parent
35f172702a
commit
67839dbfb9
31
yoga-app/src/components/next.blocks.renderer.tsx
Normal file
31
yoga-app/src/components/next.blocks.renderer.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
'use client';
|
||||
import {BlocksContent, BlocksRenderer} from "@strapi/blocks-react-renderer";
|
||||
import strapiApi from "@/api/strapi/strapi-api";
|
||||
import React from "react";
|
||||
import YogaImageComponent from "@/components/yoga.image.component";
|
||||
|
||||
export interface Props{
|
||||
content: BlocksContent;
|
||||
}
|
||||
const NextBlocksRenderer = ({ content }: Props) => {
|
||||
return (
|
||||
<BlocksRenderer
|
||||
content={content}
|
||||
blocks={{
|
||||
image: ({image}) => {
|
||||
console.log(image);
|
||||
const url = new URL(image.url);
|
||||
return (
|
||||
<YogaImageComponent
|
||||
src={url.pathname}
|
||||
width={image.width}
|
||||
height={image.height}
|
||||
alt={image.alternativeText || ""}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}}
|
||||
/>);
|
||||
}
|
||||
|
||||
export default NextBlocksRenderer;
|
||||
Reference in New Issue
Block a user