Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
import 'calypso/state/comments/init';
/**
* Return comment counts for the given site and post ID, if applicable.
* @param {Object} state Redux state
* @param {number} siteId Site identifier
* @param {number} [postId] Post identifier
* @returns {Object} The requested comment counts
*/
export function getSiteCommentCounts( state, siteId, postId ) {
if ( postId ) {
return state.comments.counts[ siteId ]?.[ postId ] ?? null;
}
return state.comments.counts[ siteId ]?.site ?? null;
}