| 1 |
/** |
| 2 |
* Internal dependencies |
| 3 |
*/ |
| 4 |
import { useHasPlayAudioAction } from './hooks'; |
| 5 |
|
| 6 |
/** |
| 7 |
* Renders its children only when the BeyondWords player can load a preview. |
| 8 |
* |
| 9 |
* @param {Object} props Component props. |
| 10 |
* @param {Element} props.children Content to gate behind the play-audio check. |
| 11 |
* |
| 12 |
* @return {Element|null} The children when the player can load, else null. |
| 13 |
*/ |
| 14 |
export default function PlayAudioCheck( { children } ) { |
| 15 |
return useHasPlayAudioAction() ? children : null; |
| 16 |
} |
| 17 |
|