Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22391866
preview.jsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
673 B
Referenced Files
None
Subscribers
None
preview.jsx
View Options
const
React
=
require
(
'react'
);
const
{
useState
,
useEffect
}
=
React
;
async
function
renderPreview
(
elements
)
{
let
html
=
''
;
for
(
const
[
component
,
componentProps
]
of
elements
)
{
html
+=
await
component
.
render
(
componentProps
);
}
return
html
;
}
module
.
exports
=
function
Preview
(
props
)
{
const
[
html
,
setHtml
]
=
useState
(
''
);
useEffect
(()
=>
{
renderPreview
(
props
.
elements
).
then
(
setHtml
);
});
return
React
.
createElement
(
'div'
,
{
style
:
{
backgroundColor
:
'#f1f1f1'
,
display
:
'flex'
,
flexFlow
:
'column'
,
height
:
'auto'
,
margin
:
'1rem'
,
padding
:
'1rem'
,
width
:
'30rem'
,
},
dangerouslySetInnerHTML
:
{
__html
:
html
,
},
});
};
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 15:43 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1214914
Default Alt Text
preview.jsx (673 B)
Attached To
Mode
rSEALPAGE Sealpage
Attached
Detach File
Event Timeline