Download wp-calypso/client/landing/stepper/hooks/use-is-plugin-bundle-eligible.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/hooks/use-is-plugin-bundle-eligible.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/hooks/use-is-plugin-bundle-eligible.ts
-
curl -L -o use-is-plugin-bundle-eligible.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/hooks/use-is-plugin-bundle-eligible.ts
707 Bytes
| import { FEATURE_WOOP, WPCOM_FEATURES_ATOMIC } from '@automattic/calypso-products'; | |
| import { useSelect } from '@wordpress/data'; | |
| import { SITE_STORE } from '../stores'; | |
| import { useSite } from './use-site'; | |
| import type { SiteSelect } from '@automattic/data-stores'; | |
| export function useIsPluginBundleEligible(): boolean | null { | |
| const site = useSite(); | |
| const hasWooFeature = useSelect( | |
| ( select ) => ( select( SITE_STORE ) as SiteSelect ).siteHasFeature( site?.ID, FEATURE_WOOP ), | |
| [ site ] | |
| ); | |
| const hasAtomicFeature = useSelect( | |
| ( select ) => | |
| ( select( SITE_STORE ) as SiteSelect ).siteHasFeature( site?.ID, WPCOM_FEATURES_ATOMIC ), | |
| [ site ] | |
| ); | |
| return hasWooFeature && hasAtomicFeature; | |
| } | |