import React from "react" ; import { List } from "@material-ui/core" ; import CommentListItem from "./CommentListItem" ; import { Comment } from "../models" ; export interface CommentsListProps { comments : Comment [ ] ; } const CommentsList = ( { comments } ) => { return ( < List data - test = "comments-list" > { comments && comments . map ( ( comment ) => < CommentListItem key = { comment . id } comment = { comment } / > ) } < /List>); } ; export default CommentsList ;