Skip to content

Commit fc57e92

Browse files
authored
Merge branch 'develop' into feature/ai-request-logging
2 parents 82d513f + 8322852 commit fc57e92

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/experiments/summarization/components/SummarizationBlockControls.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ const { aiSummarizationData } = window as any;
2525
const Controls = () => {
2626
const { isSummarizing, hasSummary, handleSummarize } =
2727
useSummaryGeneration();
28-
const buttonLabel = hasSummary
29-
? __( 'Re-generate Summary', 'ai' )
30-
: __( 'Generate Summary', 'ai' );
28+
let buttonLabel: string = __( 'Generate Summary', 'ai' );
29+
30+
if ( isSummarizing ) {
31+
buttonLabel = __( 'Generating…', 'ai' );
32+
} else if ( hasSummary ) {
33+
buttonLabel = __( 'Re-generate Summary', 'ai' );
34+
}
3135

3236
// Don't render if disabled.
3337
if ( ! aiSummarizationData?.enabled ) {

src/experiments/summarization/components/SummarizationPlugin.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ export default function SummarizationPlugin() {
2424
const { isSummarizing, hasSummary, handleSummarize } =
2525
useSummaryGeneration();
2626

27-
const buttonLabel = hasSummary
28-
? __( 'Re-generate Summary', 'ai' )
29-
: __( 'Generate Summary', 'ai' );
27+
let buttonLabel: string = __( 'Generate Summary', 'ai' );
28+
29+
if ( isSummarizing ) {
30+
buttonLabel = __( 'Generating…', 'ai' );
31+
} else if ( hasSummary ) {
32+
buttonLabel = __( 'Re-generate Summary', 'ai' );
33+
}
3034
const buttonDescription = hasSummary
3135
? __(
3236
'This will update the AI generated summary block with a new summary of the content of this post.',

0 commit comments

Comments
 (0)