import * as React from 'react'; import CommentList from './CommentList'; import Spinner from '../shared/Spinner'; import { DangerText } from '../shared/CustomTexts'; import IComment from '../../interfaces/IComment'; interface Props { postId: number; comments: Array; areLoading: boolean; error: string; requestComments(postId: number, page?: number); } class CommentsP extends React.Component { componentDidMount() { this.props.requestComments(this.props.postId); } render() { const { comments, areLoading, error, } = this.props; return (

Comments

{ areLoading ? : null } { error ? {error} : null }
); } } export default CommentsP;