Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ const { aiSummarizationData } = window as any;
const Controls = () => {
const { isSummarizing, hasSummary, handleSummarize } =
useSummaryGeneration();
const buttonLabel = hasSummary
? __( 'Re-generate Summary', 'ai' )
: __( 'Generate Summary', 'ai' );
let buttonLabel: string = __( 'Generate Summary', 'ai' );

if ( isSummarizing ) {
buttonLabel = __( 'Generating…', 'ai' );
} else if ( hasSummary ) {
buttonLabel = __( 'Re-generate Summary', 'ai' );
}

// Don't render if disabled.
if ( ! aiSummarizationData?.enabled ) {
Expand Down
10 changes: 7 additions & 3 deletions src/experiments/summarization/components/SummarizationPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ export default function SummarizationPlugin() {
const { isSummarizing, hasSummary, handleSummarize } =
useSummaryGeneration();

const buttonLabel = hasSummary
? __( 'Re-generate Summary', 'ai' )
: __( 'Generate Summary', 'ai' );
let buttonLabel: string = __( 'Generate Summary', 'ai' );

if ( isSummarizing ) {
buttonLabel = __( 'Generating…', 'ai' );
} else if ( hasSummary ) {
buttonLabel = __( 'Re-generate Summary', 'ai' );
}
const buttonDescription = hasSummary
? __(
'This will update the AI generated summary block with a new summary of the content of this post.',
Expand Down
Loading