Download wp-calypso/client/blocks/comments/comment-count.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 802 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/comments/comment-count.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/blocks/comments/comment-count.jsx
-
curl -L -o comment-count.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/comments/comment-count.jsx
802 Bytes
| import { localize } from 'i18n-calypso'; | |
| import PropTypes from 'prop-types'; | |
| import './comment-count.scss'; | |
| const CommentCount = ( { count, translate } ) => { | |
| let countPhrase; | |
| if ( count > 0 ) { | |
| countPhrase = ( | |
| <span className="comments__comment-count-phrase"> | |
| { translate( '%(commentCount)d comment', '%(commentCount)d comments', { | |
| count, | |
| args: { | |
| commentCount: count, | |
| }, | |
| } ) } | |
| </span> | |
| ); | |
| } else { | |
| countPhrase = translate( '{{span}}No comments{{/span}} - add the first!', { | |
| components: { | |
| span: <span className="comments__comment-count-phrase" />, | |
| }, | |
| } ); | |
| } | |
| return <div className="comments__comment-count">{ countPhrase }</div>; | |
| }; | |
| CommentCount.propTypes = { | |
| count: PropTypes.number.isRequired, | |
| }; | |
| export default localize( CommentCount ); | |