react-code-dataset / wp-calypso /client /state /selectors /can-user-purchase-gsuite.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
import { getCurrentUser } from 'calypso/state/current-user/selectors';
/**
* Determines whether G Suite can be purchased by the user based on their country.
* @param {Object} state Global state tree
* @returns {boolean} true if the user is allowed to purchase G Suite, false otherwise
*/
export default function canUserPurchaseGSuite( state ) {
const user = getCurrentUser( state );
return user?.is_valid_google_apps_country ?? false;
}