@@ -5,8 +5,8 @@ import {isEmpty} from 'lodash';
5
5
import cloneDeep from 'lodash/cloneDeep' ;
6
6
7
7
import type { StringIndependentInput , StringSpec } from '../../../../core' ;
8
- import { useRenderHtml } from '../../../../core/components/Form/hooks/useRenderHtml' ;
9
8
import { block } from '../../../utils' ;
9
+ import { HTMLContent } from '../../HTMLContent' ;
10
10
import { LazyLoader } from '../../LazyLoader' ;
11
11
12
12
import { loadIcon } from './utils' ;
@@ -19,14 +19,12 @@ export interface TextContentComponentProps {
19
19
spec : StringSpec ;
20
20
value ?: string ;
21
21
Layout ?: React . FC < { spec : StringSpec ; children : React . ReactElement } > ;
22
- renderHtml ?: ReturnType < typeof useRenderHtml > ;
23
22
}
24
23
25
24
export const TextContentComponent : React . FC < TextContentComponentProps > = ( {
26
25
spec,
27
26
value,
28
27
Layout,
29
- renderHtml,
30
28
} ) => {
31
29
const { textContentParams, layoutDescription} = spec . viewSpec ;
32
30
@@ -43,7 +41,7 @@ export const TextContentComponent: React.FC<TextContentComponentProps> = ({
43
41
< LazyLoader component = { loadIcon ( textContentParams ?. icon ) } />
44
42
) : undefined ;
45
43
46
- let content = renderHtml ? renderHtml ( text ) : < span dangerouslySetInnerHTML = { { __html : text } } /> ;
44
+ let content = < HTMLContent html = { text } /> ;
47
45
48
46
if ( textContentParams ?. themeAlert ) {
49
47
const titleAlert =
@@ -114,8 +112,6 @@ export const TextContent: StringIndependentInput = ({
114
112
meta,
115
113
layoutProps,
116
114
} ) => {
117
- const renderHtml = useRenderHtml ( ) ;
118
-
119
115
const WrappedLayout = React . useMemo ( ( ) => {
120
116
if ( Layout ) {
121
117
const Component : TextContentComponentProps [ 'Layout' ] = ( props ) => {
@@ -137,12 +133,5 @@ export const TextContent: StringIndependentInput = ({
137
133
return undefined ;
138
134
} , [ Layout , layoutProps , input , arrayInput , meta , name ] ) ;
139
135
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 } /> ;
148
137
} ;
0 commit comments