Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react'
import { Row, Col, Input, Icon, Tag, Affix, Card, Divider } from 'antd'
import { Route } from 'react-router-dom'
import { Base64 } from 'js-base64'
import mermaid from 'mermaid'
import Error from './Error'
import Preview from './Preview'
import pkg from 'mermaid/package.json'
import { base64ToState } from '../utils'
const mermaidVersion = pkg.version
class Edit extends React.Component {
constructor (props) {
super(props)
this.onCodeChange = this.onCodeChange.bind(this)
this.onMermaidConfigChange = this.onMermaidConfigChange.bind(this)
const {
match: {
params: { base64 }
},
location: { search }
} = this.props
this.json = base64ToState(base64, search)
mermaid.initialize(this.json.mermaid)
}