@@ -5,8 +5,8 @@ import {isEmpty} from 'lodash';
55import cloneDeep from 'lodash/cloneDeep' ;
66
77import type { StringIndependentInput , StringSpec } from '../../../../core' ;
8- import { useRenderHtml } from '../../../../core/components/Form/hooks/useRenderHtml' ;
98import { block } from '../../../utils' ;
9+ import { HTMLContent } from '../../HTMLContent' ;
1010import { LazyLoader } from '../../LazyLoader' ;
1111
1212import { loadIcon } from './utils' ;
@@ -19,14 +19,12 @@ export interface TextContentComponentProps {
1919 spec : StringSpec ;
2020 value ?: string ;
2121 Layout ?: React . FC < { spec : StringSpec ; children : React . ReactElement } > ;
22- renderHtml ?: ReturnType < typeof useRenderHtml > ;
2322}
2423
2524export const TextContentComponent : React . FC < TextContentComponentProps > = ( {
2625 spec,
2726 value,
2827 Layout,
29- renderHtml,
3028} ) => {
3129 const { textContentParams, layoutDescription} = spec . viewSpec ;
3230
@@ -43,7 +41,7 @@ export const TextContentComponent: React.FC<TextContentComponentProps> = ({
4341 < LazyLoader component = { loadIcon ( textContentParams ?. icon ) } />
4442 ) : undefined ;
4543
46- let content = renderHtml ? renderHtml ( text ) : < span dangerouslySetInnerHTML = { { __html : text } } /> ;
44+ let content = < HTMLContent html = { text } /> ;
4745
4846 if ( textContentParams ?. themeAlert ) {
4947 const titleAlert =
@@ -114,8 +112,6 @@ export const TextContent: StringIndependentInput = ({
114112 meta,
115113 layoutProps,
116114} ) => {
117- const renderHtml = useRenderHtml ( ) ;
118-
119115 const WrappedLayout = React . useMemo ( ( ) => {
120116 if ( Layout ) {
121117 const Component : TextContentComponentProps [ 'Layout' ] = ( props ) => {
@@ -137,12 +133,5 @@ export const TextContent: StringIndependentInput = ({
137133 return undefined ;
138134 } , [ Layout , layoutProps , input , arrayInput , meta , name ] ) ;
139135
140- return (
141- < TextContentComponent
142- spec = { spec }
143- value = { input . value }
144- Layout = { WrappedLayout }
145- renderHtml = { renderHtml }
146- />
147- ) ;
136+ return < TextContentComponent spec = { spec } value = { input . value } Layout = { WrappedLayout } /> ;
148137} ;
0 commit comments