PluginProbe
BeyondWords – AI audio for publishers / 4.0.0
BeyondWords – AI audio for publishers v4.0.0
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / Component / Post / PendingNotice / index.js

index.js in BeyondWords – AI audio for publishers 4.0.0, at src/Component/Post/PendingNotice/index.js

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import { sprintf, __ } from '@wordpress/i18n';
5 import { ExternalLink } from '@wordpress/components';
6 import { compose } from '@wordpress/compose';
7 import { withSelect } from '@wordpress/data';
8 import { Fragment } from '@wordpress/element';
9
10 /**
11 * Internal dependencies
12 */
13 import PendingNoticeCheck from './check';
14
15 export function PendingNotice( { projectUrl, wrapper } ) {
16 const Wrapper = wrapper || Fragment;
17
18 return (
19 <PendingNoticeCheck>
20 <Wrapper>
21 <div>
22 <p>
23 { __(
24 'Listen to content saved as “Pending” in the BeyondWords dashboard.',
25 'speechkit'
26 ) }
27 </p>
28 <ExternalLink href={ projectUrl }>
29 { __( 'BeyondWords dashboard.', 'speechkit' ) }
30 </ExternalLink>
31 </div>
32 </Wrapper>
33 </PendingNoticeCheck>
34 );
35 }
36
37 export default compose( [
38 withSelect( ( select ) => {
39 const { getEditedPostAttribute } = select( 'core/editor' );
40
41 const beyondwordsProjectId =
42 getEditedPostAttribute( 'meta' ).beyondwords_project_id;
43 const speechkitProjectId =
44 getEditedPostAttribute( 'meta' ).speechkit_project_id;
45
46 const projectId = beyondwordsProjectId || speechkitProjectId;
47
48 const projectUrl = sprintf(
49 '%1$s/dashboard/project/%2$d/content',
50 process.env.BEYONDWORDS_DASHBOARD_URL,
51 projectId
52 );
53
54 return {
55 projectUrl,
56 };
57 } ),
58 ] )( PendingNotice );
59