react-code-dataset / wp-calypso /client /state /ui /selectors /get-selected-site.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
Raw History Blame Contribute Delete
504 Bytes
import getSite from 'calypso/state/sites/selectors/get-site';
import getSelectedSiteId from './get-selected-site-id';
import type { SiteDetails } from '@automattic/data-stores';
import type { AppState } from 'calypso/types';
/**
* Returns the site object for the currently selected site.
*/
export default function getSelectedSite( state: AppState ): SiteDetails | null | undefined {
const siteId = getSelectedSiteId( state );
if ( ! siteId ) {
return null;
}
return getSite( state, siteId );
}