"use client" import { Link, RotateCw, TerminalSquare, } from "lucide-react" import { useRef, useState } from "react" import { toast } from "sonner" export default function PreviewWindow({ collapsed, open, src }: { collapsed: boolean open: () => void src: string }) { const ref = useRef(null) const [iframeKey, setIframeKey] = useState(0) return ( <>
Preview
{collapsed ? ( { }}> ) : ( <> {/* Removed the unfoldvertical button since we have the same thing via the run button. */} { navigator.clipboard.writeText(src) toast.info("Copied preview link to clipboard") }} > { // if (ref.current) { // ref.current.contentWindow?.location.reload(); // } setIframeKey((prev) => prev + 1) }} > )}
{collapsed ? null : (