@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
13 lines (12 loc) • 1.39 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { marked } from 'marked';
import { SanitizerService } from '../../../../services/sanitizer-service';
export function RichTextSection({ sectionData, isLoading, cssClassName }) {
if (isLoading) {
return (_jsx("div", { className: "skeleton-loader d-flex justify-content-center mb-4", children: _jsxs("svg", { width: "808", height: "199", viewBox: "0 0 808 199", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { x: "299", width: "211", height: "38", fill: "#F0F0F0" }), _jsx("rect", { y: "96", width: "808", height: "16", fill: "#F0F0F0" }), _jsx("rect", { y: "125", width: "738", height: "16", fill: "#F0F0F0" }), _jsx("rect", { y: "154", width: "808", height: "16", fill: "#F0F0F0" }), _jsx("rect", { y: "183", width: "738", height: "16", fill: "#F0F0F0" })] }) }));
}
const sanitizer = SanitizerService.getInstance();
const sectionDataParsed = typeof sectionData === 'string' ? sectionData : '';
const markedownToHtml = marked.parse(sectionDataParsed || '', { async: false });
return (_jsx("div", { className: `container ${cssClassName}`, children: _jsx("section", { className: "row pt-5 pb-5", children: _jsx("div", { className: "col-md-12 ", children: _jsx("div", { dangerouslySetInnerHTML: { __html: sanitizer.sanitizeHtml(markedownToHtml) } }) }) }) }));
}