"use client" import { ChevronLeft, ChevronRight, Globe, Link, RotateCw, TerminalSquare, UnfoldVertical, } 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 ? ( ) : ( <> {/* Todo, make this open inspector */} {/* {}}> */} { 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 : (