2
2
* External dependencies
3
3
*/
4
4
import { JetpackEditorPanelLogo , useAnalytics } from '@automattic/jetpack-shared-extension-utils' ;
5
- import { PanelBody , PanelRow , BaseControl , ExternalLink } from '@wordpress/components' ;
5
+ import { PanelBody , PanelRow , BaseControl , ExternalLink , Notice } from '@wordpress/components' ;
6
6
import { store as coreStore } from '@wordpress/core-data' ;
7
7
import { useSelect } from '@wordpress/data' ;
8
8
import { PluginPrePublishPanel , PluginDocumentSettingPanel } from '@wordpress/edit-post' ;
@@ -81,6 +81,8 @@ const JetpackAndSettingsContent = ( {
81
81
// return postTypeObject?.viewable;
82
82
// }, [] );
83
83
84
+ const isPostEmpty = useSelect ( select => select ( editorStore ) . isEditedPostEmpty ( ) , [ ] ) ;
85
+
84
86
const currentTitleOptimizationSectionLabel = __ ( 'Optimize Publishing' , 'jetpack' ) ;
85
87
const SEOTitleOptimizationSectionLabel = __ ( 'Optimize Title' , 'jetpack' ) ;
86
88
const titleOptimizationSectionLabel = isAITitleOptimizationKeywordsFeatureAvailable
@@ -110,24 +112,25 @@ const JetpackAndSettingsContent = ( {
110
112
</PanelRow>
111
113
) } */ }
112
114
115
+ { isPostEmpty && (
116
+ < PanelRow className = "jetpack-ai-sidebar__warning-content" >
117
+ < Notice isDismissible = { false } status = "warning" >
118
+ { __ ( 'The following features require content to work.' , 'jetpack' ) }
119
+ </ Notice >
120
+ </ PanelRow >
121
+ ) }
122
+
113
123
{ canWriteBriefBeEnabled ( ) && isBreveAvailable && (
114
124
< PanelRow >
115
125
< BaseControl __nextHasNoMarginBottom = { true } >
116
126
< BaseControl . VisualLabel >
117
- { __ ( 'Write Brief with AI (BETA )' , 'jetpack' ) }
127
+ { __ ( 'Write Brief (Beta )' , 'jetpack' ) }
118
128
</ BaseControl . VisualLabel >
119
129
< Breve />
120
130
</ BaseControl >
121
131
</ PanelRow >
122
132
) }
123
133
124
- < PanelRow className = "jetpack-ai-sidebar__feature-section" >
125
- < BaseControl __nextHasNoMarginBottom = { true } >
126
- < BaseControl . VisualLabel > { __ ( 'AI Feedback' , 'jetpack' ) } </ BaseControl . VisualLabel >
127
- < Feedback placement = { placement } busy = { false } disabled = { requireUpgrade } />
128
- </ BaseControl >
129
- </ PanelRow >
130
-
131
134
{ isAITitleOptimizationAvailable && (
132
135
< PanelRow className = "jetpack-ai-sidebar__feature-section" >
133
136
< BaseControl __nextHasNoMarginBottom = { true } >
@@ -136,16 +139,25 @@ const JetpackAndSettingsContent = ( {
136
139
</ BaseControl >
137
140
</ PanelRow >
138
141
) }
142
+
139
143
{ isAIFeaturedImageAvailable && (
140
144
< PanelRow className = "jetpack-ai-sidebar__feature-section" >
141
145
< BaseControl __nextHasNoMarginBottom = { true } >
142
146
< BaseControl . VisualLabel >
143
- { __ ( 'AI Featured Image' , 'jetpack' ) }
147
+ { __ ( 'Get Featured Image' , 'jetpack' ) }
144
148
</ BaseControl . VisualLabel >
145
149
< FeaturedImage busy = { false } disabled = { requireUpgrade } placement = { placement } />
146
150
</ BaseControl >
147
151
</ PanelRow >
148
152
) }
153
+
154
+ < PanelRow className = "jetpack-ai-sidebar__feature-section" >
155
+ < BaseControl __nextHasNoMarginBottom = { true } >
156
+ < BaseControl . VisualLabel > { __ ( 'Get Feedback' , 'jetpack' ) } </ BaseControl . VisualLabel >
157
+ < Feedback placement = { placement } busy = { false } disabled = { requireUpgrade } />
158
+ </ BaseControl >
159
+ </ PanelRow >
160
+
149
161
{ requireUpgrade && ! isUsagePanelAvailable && (
150
162
< PanelRow >
151
163
< Upgrade placement = { placement } type = { upgradeType } upgradeUrl = { checkoutUrl } />
@@ -157,21 +169,21 @@ const JetpackAndSettingsContent = ( {
157
169
</ PanelRow >
158
170
) }
159
171
160
- < PanelRow >
161
- < ExternalLink href = "https://jetpack.com/redirect/?source=jetpack-ai-feedback" >
162
- { __ ( 'Provide feedback ' , 'jetpack' ) }
172
+ < PanelRow className = "jetpack-ai-sidebar__external-link" >
173
+ < ExternalLink href = { productPageUrl } >
174
+ { __ ( 'Learn more about Jetpack AI ' , 'jetpack' ) }
163
175
</ ExternalLink >
164
176
</ PanelRow >
165
177
166
- < PanelRow >
167
- < ExternalLink href = { productPageUrl } >
168
- { __ ( 'Learn more about Jetpack AI ' , 'jetpack' ) }
178
+ < PanelRow className = "jetpack-ai-sidebar__external-link" >
179
+ < ExternalLink href = "https://jetpack.com/redirect/?source=jetpack-ai-feedback" >
180
+ { __ ( 'Give us feedback ' , 'jetpack' ) }
169
181
</ ExternalLink >
170
182
</ PanelRow >
171
183
172
- < PanelRow >
184
+ < PanelRow className = "jetpack-ai-sidebar__external-link" >
173
185
< ExternalLink href = "https://jetpack.com/redirect/?source=ai-guidelines" >
174
- { __ ( 'AI Guidelines ' , 'jetpack' ) }
186
+ { __ ( 'AI guidelines ' , 'jetpack' ) }
175
187
</ ExternalLink >
176
188
</ PanelRow >
177
189
</ >
0 commit comments