const { h, Component } = require('preact') const { decode } = require('reshape-preact-components') const marked = require('8fold-marked') const Image = require('@hashicorp/hashi-image').default const AlertIcon = require('./alert-icon') const CheckIcon = require('./check-icon') module.exports = class BeforeAfterDiagram extends Component { render() { const data = decode(this.props._data) const markedOptions = this.generateMarkedOptions() return (
{data.before_headline && (

)} {data.before_content && (
)}

{data.after_headline && (

)} {data.after_content && (
)}

) } generateMarkedOptions() { const markedRenderer = new marked.Renderer() markedRenderer.heading = function(text, level) { return `${text}` } markedRenderer.paragraph = function(text) { return `

${text}

` } markedRenderer.list = function(text) { return `` } return { renderer: markedRenderer } } }