homegrade_blocks_production/blocks/chapitrage-thematique/src/lien-chapitre/save.js

40 lines
980 B
JavaScript

import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor";
import { __ } from "@wordpress/i18n";
import arrow from "../img/arrow-right-circle.svg";
export default function save({ attributes }) {
let { chapterLinkTitle, chapterLinkDescription, chapterLinkRelatedPostUrl } =
attributes;
return (
<div
{...useBlockProps.save({
className: `homegrade-blocks-lien-chapitre`,
})}
>
<RichText.Content
tagName="h4"
value={chapterLinkTitle}
className="homegrade-blocks-lien-chapitre__title"
/>
<RichText.Content
tagName="p"
value={chapterLinkDescription}
className="homegrade-blocks-lien-chapitre__description"
/>
{chapterLinkRelatedPostUrl && (
<a
className="homegrade-blocks-lien-chapitre__cta"
href={chapterLinkRelatedPostUrl}
>
{__("En savoir plus", "homegrade-blocks")}
<div class="cta_arrow_button">
<img src={arrow} alt="" />
</div>
</a>
)}
</div>
);
}