2017-05-19 07:43:29 +02:00
|
|
|
import Inferno from 'inferno';
|
|
|
|
import Component from 'inferno-component';
|
|
|
|
import marked from 'marked';
|
|
|
|
|
|
|
|
import idManager from '../../managers/IDManager';
|
2017-07-26 06:11:33 +02:00
|
|
|
import { Word } from '../../managers/Word';
|
2017-05-19 07:43:29 +02:00
|
|
|
|
2017-07-26 06:11:33 +02:00
|
|
|
import { WordForm } from '../management/WordForm';
|
2017-05-19 07:43:29 +02:00
|
|
|
|
|
|
|
export class WordDisplay extends Component {
|
|
|
|
constructor (props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
2017-07-26 06:11:33 +02:00
|
|
|
isEditing: false,
|
2017-05-19 07:43:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<div className='card'>
|
|
|
|
|
|
|
|
<header className='card-header'>
|
|
|
|
<h3 className='card-header-title'>
|
2017-07-26 06:11:33 +02:00
|
|
|
{ this.props.word.name }
|
2017-05-19 07:43:29 +02:00
|
|
|
</h3>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<section className='card-content'>
|
|
|
|
<div className='content'>
|
2017-08-21 23:12:46 +02:00
|
|
|
{
|
|
|
|
(this.props.word.pronunciation || this.props.word.partOfSpeech)
|
|
|
|
&& (
|
|
|
|
<p>
|
|
|
|
{
|
|
|
|
(this.props.word.partOfSpeech)
|
|
|
|
? (<small>{ this.props.word.partOfSpeech }</small>)
|
|
|
|
: ''
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
(this.props.word.partOfSpeech && this.props.word.pronunciation)
|
|
|
|
? ' | '
|
|
|
|
: ''
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
(this.props.word.pronunciation)
|
|
|
|
? (<small>{ this.props.word.pronunciation }</small>)
|
|
|
|
: ''
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
)
|
|
|
|
}
|
2017-05-19 07:43:29 +02:00
|
|
|
|
2017-08-21 23:12:46 +02:00
|
|
|
{
|
|
|
|
(this.props.word.definition)
|
2017-05-19 07:43:29 +02:00
|
|
|
&& (
|
|
|
|
<p>
|
2017-07-26 06:11:33 +02:00
|
|
|
{ this.props.word.definition }
|
2017-05-19 07:43:29 +02:00
|
|
|
</p>
|
2017-08-21 23:12:46 +02:00
|
|
|
)
|
|
|
|
}
|
2017-05-19 07:43:29 +02:00
|
|
|
|
2017-08-21 23:12:46 +02:00
|
|
|
{
|
|
|
|
(this.props.word.details)
|
2017-05-19 07:43:29 +02:00
|
|
|
&& (
|
|
|
|
<p>
|
2017-07-26 06:11:33 +02:00
|
|
|
{ this.props.word.details }
|
2017-05-19 07:43:29 +02:00
|
|
|
</p>
|
2017-08-21 23:12:46 +02:00
|
|
|
)
|
|
|
|
}
|
2017-05-19 07:43:29 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|