diff --git a/src/editor/popup/components/ai-response/index.js b/src/editor/popup/components/ai-response/index.js
index 11342c4..4b97e2d 100644
--- a/src/editor/popup/components/ai-response/index.js
+++ b/src/editor/popup/components/ai-response/index.js
@@ -12,12 +12,9 @@ import './style.scss';
import { memo, useState, useEffect, useRef } from '@wordpress/element';
import { BlockPreview } from '@wordpress/block-editor';
-function RenderPreview({ response, className, style }) {
+function RenderPreview({ response }) {
return (
-
+
+
{(preview1Data.length > 0 || preview2Data.length > 0) && (
-
-
-
-
+ <>
+
+
+ >
)}
);
diff --git a/src/editor/popup/components/ai-response/style.scss b/src/editor/popup/components/ai-response/style.scss
index 44352ac..8b9631e 100644
--- a/src/editor/popup/components/ai-response/style.scss
+++ b/src/editor/popup/components/ai-response/style.scss
@@ -1,4 +1,6 @@
.mind-popup-response {
+ position: relative;
+
/* GPU acceleration */
transform: translateZ(0);
will-change: transform;
@@ -17,6 +19,18 @@
will-change: opacity;
backface-visibility: hidden;
transform: translateZ(0);
+ z-index: 2;
+}
+
+// Hidden preview styles.
+.mind-popup-response--1 .mind-popup-response__preview:nth-child(2),
+.mind-popup-response--2 .mind-popup-response__preview:nth-child(1), {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ opacity: 0;
+ z-index: 1;
}
@keyframes mind-cursor-blink {