var React = require('react'); var PostContentHelper = require('../common/PostContentHelper.js'); module.exports = Post = React.createClass({ render: function() { var parsedContent = PostContentHelper.parseContent(this.props.content); //console.log(parsedContent) var ret = parsedContent.map(function(item,index){ //console.log(item.raw) switch(item.type) { case "mention": return ( {item.raw} ) case "hashtag": return ( {item.raw} ) case "url": return ( {item.raw} ) case "email": return ( {item.raw} ) default: return ( {item.raw} ) } }); //console.log(ret); return (
{ret}
); } }); /*
{this.state.fullname} @{post.username} - {post.id}
{post.timestamp}
{post.content}

*/