import { useEffect, useState } from "react"; import LivePreviewFrame from "./live-preview-frame"; export default function WebBrowser({ url, sessionId, isScrapeComplete, children, }: { url?: string; sessionId: string; isScrapeComplete: boolean; children?: React.ReactNode; }) { const [isLoading, setIsLoading] = useState(true); const [isVisible, setIsVisible] = useState(false); useEffect(() => { // Add a slight delay before showing the browser to ensure smooth entrance const timer = setTimeout(() => { setIsVisible(true); setIsLoading(false); }, 100); return () => clearTimeout(timer); }, []); return (
{/* macOS-style top bar with loading indicator */}
{/* Spinner */}
{/* Content area with fade transition */}
{ console.log("Scrape complete"); setIsLoading(false); } : undefined } > {children}
); }