[yoga-6] add nextBlocksRenderer to render json based rich text

This commit is contained in:
Roland Schneider
2025-05-23 14:38:14 +02:00
parent 67839dbfb9
commit f33e97666e
2 changed files with 23 additions and 11 deletions

View File

@@ -1,6 +1,5 @@
'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";
@@ -13,13 +12,11 @@ const NextBlocksRenderer = ({ content }: Props) => {
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}
src={image.url}
// width={image.width}
// height={image.height}
alt={image.alternativeText || ""}
/>
);