'use strict'

import React from 'react';

const Paragraph = React.createClass({

    statics: {

        getDefaultData(){
            return '《永远的蝴蝶》是台湾著名作家陈启佑先生的一篇小小说。这是一篇散文化的微型小说，<a href="#">fdsffdsd</a>其语言具有较强的抒情色彩，立意含蓄隽永 。作品情节很简单，写的是一个凄美的爱情故事。在一个雨天，“我”的恋人樱子自愿帮“我”到马路对面去寄信。随着一阵拔尖的刹车声，樱子年轻的生命消逝了。'
        }
    },

    getDefaultProps: function () {
        return {
            'data-type': 'Paragraph',
            'tag': 'div'
        };
    },

    render: function () {
        var html = this.props.data || Paragraph.getDefaultData()
        var ComponentClass = this.props.tag
        var ContentEditable = this.props.contentEditableClass

        if (this.props.isEditMode) {
            return (
                <ContentEditable
                    {...this.props}
                    html={html}>
                </ContentEditable>
            )
        } else {
            return (<ComponentClass
                className={this.props.className}
                dangerouslySetInnerHTML={{__html: html}}></ComponentClass>)
        }
    }
})

export default Paragraph;