Spaces:
Sleeping
Sleeping
cleaning footer
Browse files
src/components/preview/preview.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import classNames from "classnames";
|
| 2 |
import { useRef } from "react";
|
| 3 |
-
import { TbReload } from "react-icons/tb";
|
| 4 |
import { toast } from "react-toastify";
|
| 5 |
import { FaLaptopCode } from "react-icons/fa6";
|
| 6 |
-
import { defaultHTML } from "../../../utils/consts";
|
| 7 |
|
| 8 |
function Preview({
|
| 9 |
html,
|
|
@@ -20,7 +20,7 @@ function Preview({
|
|
| 20 |
}) {
|
| 21 |
const iframeRef = useRef<HTMLIFrameElement | null>(null);
|
| 22 |
|
| 23 |
-
const handleRefreshIframe = () => {
|
| 24 |
if (iframeRef.current) {
|
| 25 |
const iframe = iframeRef.current;
|
| 26 |
const content = iframe.srcdoc;
|
|
@@ -29,7 +29,7 @@ function Preview({
|
|
| 29 |
iframe.srcdoc = content;
|
| 30 |
}, 10);
|
| 31 |
}
|
| 32 |
-
}
|
| 33 |
|
| 34 |
return (
|
| 35 |
<div
|
|
@@ -59,24 +59,24 @@ function Preview({
|
|
| 59 |
<FaLaptopCode className="text-sm" />
|
| 60 |
Hide preview
|
| 61 |
</button>
|
| 62 |
-
{html === defaultHTML && (
|
| 63 |
-
|
| 64 |
href="https://huggingface.co/spaces/victor/deepsite-gallery"
|
| 65 |
target="_blank"
|
| 66 |
className="bg-gray-200 text-gray-950 text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-200 hover:bg-gray-300 transition-all duration-100 cursor-pointer"
|
| 67 |
>
|
| 68 |
🖼️ <span>DeepSite Gallery</span>
|
| 69 |
-
</a
|
| 70 |
-
)}
|
| 71 |
-
{!isAiWorking && (
|
| 72 |
-
|
| 73 |
className="bg-white lg:bg-gray-950 shadow-md text-gray-950 lg:text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 lg:border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
|
| 74 |
onClick={handleRefreshIframe}
|
| 75 |
>
|
| 76 |
<TbReload className="text-sm" />
|
| 77 |
Refresh Preview
|
| 78 |
-
</button
|
| 79 |
-
)}
|
| 80 |
</div>
|
| 81 |
</div>
|
| 82 |
);
|
|
|
|
| 1 |
import classNames from "classnames";
|
| 2 |
import { useRef } from "react";
|
| 3 |
+
//import { TbReload } from "react-icons/tb";
|
| 4 |
import { toast } from "react-toastify";
|
| 5 |
import { FaLaptopCode } from "react-icons/fa6";
|
| 6 |
+
//import { defaultHTML } from "../../../utils/consts";
|
| 7 |
|
| 8 |
function Preview({
|
| 9 |
html,
|
|
|
|
| 20 |
}) {
|
| 21 |
const iframeRef = useRef<HTMLIFrameElement | null>(null);
|
| 22 |
|
| 23 |
+
/*const handleRefreshIframe = () => {
|
| 24 |
if (iframeRef.current) {
|
| 25 |
const iframe = iframeRef.current;
|
| 26 |
const content = iframe.srcdoc;
|
|
|
|
| 29 |
iframe.srcdoc = content;
|
| 30 |
}, 10);
|
| 31 |
}
|
| 32 |
+
};*/
|
| 33 |
|
| 34 |
return (
|
| 35 |
<div
|
|
|
|
| 59 |
<FaLaptopCode className="text-sm" />
|
| 60 |
Hide preview
|
| 61 |
</button>
|
| 62 |
+
{/*{html === defaultHTML && (
|
| 63 |
+
<a
|
| 64 |
href="https://huggingface.co/spaces/victor/deepsite-gallery"
|
| 65 |
target="_blank"
|
| 66 |
className="bg-gray-200 text-gray-950 text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-200 hover:bg-gray-300 transition-all duration-100 cursor-pointer"
|
| 67 |
>
|
| 68 |
🖼️ <span>DeepSite Gallery</span>
|
| 69 |
+
</a>
|
| 70 |
+
)}*/}
|
| 71 |
+
{/*{!isAiWorking && (
|
| 72 |
+
<button
|
| 73 |
className="bg-white lg:bg-gray-950 shadow-md text-gray-950 lg:text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 lg:border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
|
| 74 |
onClick={handleRefreshIframe}
|
| 75 |
>
|
| 76 |
<TbReload className="text-sm" />
|
| 77 |
Refresh Preview
|
| 78 |
+
</button>
|
| 79 |
+
)}*/}
|
| 80 |
</div>
|
| 81 |
</div>
|
| 82 |
);
|