Sha256: 9f962aa6f2cfd00fbe17aa96d9729b166fb849192c34baf52ef42202c60bb183
Contents?: true
Size: 1.07 KB
Versions: 1024
Compression:
Stored size: 1.07 KB
Contents
import React, { useState } from 'react' import { Button, Card, RichTextEditor, } from '../../' const RichTextEditorPreview = (props) => { const [showPreview, setShowPreview] = useState(false) const [previewText, setPreviewText] = useState(<div />) const handleChange = (event) => setPreviewText(event) const handleClick = () => { setShowPreview(true) } return ( <div> <RichTextEditor id="content-preview-editor" onChange={handleChange} {...props} /> <If condition={showPreview}> <Card marginTop="md"> <div className="trix-content" // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: previewText }} id="preview-content" /> </Card> <Else /> <div /> </If> <Button id="preview-button" marginTop="md" onClick={handleClick} text="Preview Output" variant="secondary" /> </div> ) } export default RichTextEditorPreview
Version data entries
1,024 entries across 1,024 versions & 2 rubygems