import {Renderer, type RendererProps} from "amis"
import React from "react"
import Markdown from "../Markdown.tsx"
import './MarkdownEnhance.scss'
import {once} from 'es-toolkit'

const MarkdownEnhance: React.FC<RendererProps> = props => {
  return (
    <div className="markdown-enhance">
      <Markdown content={props.content}/>
    </div>
  )
}

const register = once(() => {
  Renderer({
    type: 'markdown-enhance',
    autoVar: true,
  })(React.memo(MarkdownEnhance))
})

register()