"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, ip, }: { collapsed: boolean; open: () => void; ip: string; }) { const ref = useRef(null); const [iframeKey, setIframeKey] = useState(0); return ( <>
Preview {/* localhost:8000 */}
{collapsed ? ( ) : ( <> {/* Todo, make this open inspector */} {/* {}}> */} { navigator.clipboard.writeText(`http://${ip}:3000`); toast.info("Copied preview link to clipboard"); }} > { // if (ref.current) { // ref.current.contentWindow?.location.reload(); // } setIframeKey((prev) => prev + 1); }} > )}
{collapsed ? null : (