# speechkit/4.1.1/src/Component/Post/PendingNotice/check.js

BeyondWords – AI audio for publishers, version 4.1.1. 33 lines.

- Page: https://pluginprobe.com/plugins/speechkit/4.1.1/code/src/Component/Post/PendingNotice/check.js
- Raw: https://pluginprobe.com/plugins/speechkit/4.1.1/raw/src/Component/Post/PendingNotice/check.js
- Modified: 2023-09-15T16:28:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/speechkit/4.1.1/code/src/Component/Post/PendingNotice/check.js#L10-L20`.

```javascript
/**
 * WordPress dependencies
 */
import { compose } from '@wordpress/compose';
import { withSelect } from '@wordpress/data';

export function PendingNoticeCheck( { hasPendingNoticeAction, children } ) {
	if ( ! hasPendingNoticeAction ) {
		return null;
	}

	return children;
}

export default compose( [
	withSelect( ( select ) => {
		const { getEditedPostAttribute } = select( 'core/editor' );

		const beyondwordsProjectId =
			getEditedPostAttribute( 'meta' ).beyondwords_project_id;
		const speechkitProjectId =
			getEditedPostAttribute( 'meta' ).speechkit_project_id;

		const status = getEditedPostAttribute( 'status' );

		const hasProjectId = beyondwordsProjectId || speechkitProjectId;

		return {
			hasPendingNoticeAction: !! hasProjectId && status === 'pending',
		};
	} ),
] )( PendingNoticeCheck );

```
