mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
27 lines
693 B
JavaScript
27 lines
693 B
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import RehypeReact from 'rehype-react'
|
|
import Repository from './Repositories/Repository'
|
|
import styles from './DocContent.module.scss'
|
|
|
|
const renderAst = new RehypeReact({
|
|
createElement: React.createElement,
|
|
components: { repo: Repository }
|
|
}).Compiler
|
|
|
|
const DocContent = ({ html, htmlAst }) =>
|
|
html ? (
|
|
<div className={styles.docContent}>{renderAst(htmlAst)}</div>
|
|
) : (
|
|
<div className={styles.empty}>
|
|
This is a placeholder for now. Help creating it.
|
|
</div>
|
|
)
|
|
|
|
DocContent.propTypes = {
|
|
html: PropTypes.string,
|
|
htmlAst: PropTypes.object
|
|
}
|
|
|
|
export default DocContent
|