Download wp-calypso/client/reader/stream/empty-search-recommended-site.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 984 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/reader/stream/empty-search-recommended-site.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/reader/stream/empty-search-recommended-site.jsx
-
curl -L -o empty-search-recommended-site.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/reader/stream/empty-search-recommended-site.jsx
984 Bytes
| import { RelatedPostCard } from 'calypso/blocks/reader-related-card'; | |
| import { recordTrackForPost, recordAction } from 'calypso/reader/stats'; | |
| export default function EmptySearchRecommendedSite( { post } ) { | |
| function handlePostClick() { | |
| recordTrackForPost( 'calypso_reader_recommended_site_clicked', post, { | |
| recommendation_source: 'empty-search-site', | |
| } ); | |
| recordAction( 'search_page_rec_post_click' ); | |
| } | |
| function handleSiteClick() { | |
| recordTrackForPost( 'calypso_reader_recommended_site_clicked', post, { | |
| recommendation_source: 'empty-search-site', | |
| } ); | |
| recordAction( 'search_page_rec_site_click' ); | |
| } | |
| const site = { title: post && post.site_name }; | |
| /* eslint-disable wpcalypso/jsx-classname-namespace */ | |
| return ( | |
| <div className="search-stream__recommendation-list-item" key={ post && post.global_ID }> | |
| <RelatedPostCard | |
| post={ post } | |
| site={ site } | |
| onSiteClick={ handleSiteClick } | |
| onPostClick={ handlePostClick } | |
| /> | |
| </div> | |
| ); | |
| } | |