fix: use the container URL for the preview panel

This commit is contained in:
James Murdza
2024-06-15 21:04:33 -04:00
parent 687416e6e9
commit 9ec59bc781
3 changed files with 11 additions and 2 deletions

View File

@ -15,9 +15,11 @@ import { toast } from "sonner"
export default function PreviewWindow({
collapsed,
open,
src
}: {
collapsed: boolean
open: () => void
src: string
}) {
const ref = useRef<HTMLIFrameElement>(null)
const [iframeKey, setIframeKey] = useState(0)
@ -45,7 +47,7 @@ export default function PreviewWindow({
<PreviewButton
onClick={() => {
navigator.clipboard.writeText(`http://localhost:5173`)
navigator.clipboard.writeText(src)
toast.info("Copied preview link to clipboard")
}}
>
@ -73,7 +75,7 @@ export default function PreviewWindow({
ref={ref}
width={"100%"}
height={"100%"}
src={`http://localhost:5173`}
src={src}
/>
</div>
)}