Download react-redux-realworld-example-app/src/components/Article/Comment.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-redux-realworld-example-app/src/components/Article/Comment.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-redux-realworld-example-app/src/components/Article/Comment.js
-
curl -L -o Comment.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-redux-realworld-example-app/src/components/Article/Comment.js
1.07 kB
| import DeleteButton from './DeleteButton'; | |
| import { Link } from 'react-router-dom'; | |
| import React from 'react'; | |
| const Comment = props => { | |
| const comment = props.comment; | |
| const show = props.currentUser && | |
| props.currentUser.username === comment.author.username; | |
| return ( | |
| <div className="card"> | |
| <div className="card-block"> | |
| <p className="card-text">{comment.body}</p> | |
| </div> | |
| <div className="card-footer"> | |
| <Link | |
| to={`/@${comment.author.username}`} | |
| className="comment-author"> | |
| <img src={comment.author.image} className="comment-author-img" alt={comment.author.username} /> | |
| </Link> | |
| | |
| <Link | |
| to={`/@${comment.author.username}`} | |
| className="comment-author"> | |
| {comment.author.username} | |
| </Link> | |
| <span className="date-posted"> | |
| {new Date(comment.createdAt).toDateString()} | |
| </span> | |
| <DeleteButton show={show} slug={props.slug} commentId={comment.id} /> | |
| </div> | |
| </div> | |
| ); | |
| }; | |
| export default Comment; | |