import { h, Component } from 'preact'; import PropTypes from 'prop-types'; import Article from './article'; export default class Content extends Component { static propTypes = { resource: PropTypes.object, activeChannelId: PropTypes.number, pusherKey: PropTypes.string, }; render() { if (!this.props.resource) { return ''; } return (
{display(this.props)}
); } } function display(props) { if (props.resource.type_of === 'loading-user') { return (
); } if (props.resource.type_of === 'article') { return
; } }