UNPKG

@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.

19 lines (18 loc) 1.02 kB
import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import React from 'react'; import { classNames } from '../../../editor/utils/classNames'; import { htmlAttributes } from '../../../editor/widget-framework/attributes'; import { SanitizerService } from '../../../services/sanitizer-service'; import { Tracer } from '@progress/sitefinity-nextjs-sdk/diagnostics/empty'; export function FormContentBlock(props) { const { span } = Tracer.traceWidget(props, false); const dataAttributes = htmlAttributes(props); const content = props.model.Properties.Content; const tagName = props.model.Properties.TagName || 'div'; dataAttributes.dangerouslySetInnerHTML = { __html: SanitizerService.getInstance().sanitizeHtml(content || '') }; const cssClasses = classNames(props.model.Properties.WrapperCssClass); dataAttributes['className'] = cssClasses; return (_jsxs(_Fragment, { children: [React.createElement(tagName, dataAttributes), Tracer.endSpan(span)] })); }