import Inferno from 'inferno'; import Component from 'inferno-component'; import marked from 'marked'; import './WordDisplay.scss'; import idManager from '../../managers/IDManager'; import { Word } from '../../managers/Word'; import { WordForm } from '../management/WordForm'; export class WordDisplay extends Component { constructor (props) { super(props); this.state = { isEditing: false, } this.wordDetailsHTML = marked(props.word.details); } componentWillUpdate (nextProps, nextState) { if (this.props.word.details !== nextProps.word.details) { this.wordDetailsHTML = marked(nextProps.word.details); } } render () { return (
{ this.props.word.name } { (this.props.word.pronunciation || this.props.word.partOfSpeech) && ( { (this.props.word.pronunciation) && ( { this.props.word.pronunciation } ) } { (this.props.word.partOfSpeech) && ( { this.props.word.partOfSpeech } ) } ) }
{ (this.props.word.definition) && (

{ this.props.word.definition }

) } { (this.props.word.details) && (

) }

); } }