Skip to content

Instantly share code, notes, and snippets.

@rodoabad
Created March 6, 2020 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodoabad/a4dba4a9efe631415f66897d8655d656 to your computer and use it in GitHub Desktop.
Save rodoabad/a4dba4a9efe631415f66897d8655d656 to your computer and use it in GitHub Desktop.
import React from 'react';
export const CommentList = ({
comments,
isLoading,
totalCount
}) => {
if (isLoading) {
return 'Loading';
}
if (comments.length === 0) {
return 'No comments yet';
}
return `${comments.length} of ${totalCount}`;
}
CommentList.defaultProps = {
comments: []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment