add(blockRenderer): add blockRenderer component to add link open to a new page
All checks were successful
Deploy Fefan / deploy (push) Successful in 4m40s
All checks were successful
Deploy Fefan / deploy (push) Successful in 4m40s
This commit is contained in:
18
next/components/blockRenderer/index.jsx
Normal file
18
next/components/blockRenderer/index.jsx
Normal file
@@ -0,0 +1,18 @@
|
||||
'use client';
|
||||
import { BlocksRenderer } from '@strapi/blocks-react-renderer';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function BlockRenderer({ content }) {
|
||||
return (
|
||||
<BlocksRenderer
|
||||
content={content}
|
||||
blocks={{
|
||||
link: ({ children, url }) => (
|
||||
<Link href={url} target="_blank">
|
||||
{children}
|
||||
</Link>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user