import Link from "next/link"
import { AlertCircle, ExternalLink } from "lucide-react"

export function WorkspaceSessionMissing({ saasUrl }: { saasUrl?: string }) {
    const fallbackUrl = saasUrl ?? process.env.NEXT_PUBLIC_SAAS_URL ?? "/"
    return (
        <div className="min-h-[60vh] flex items-center justify-center p-6">
            <div className="max-w-md w-full text-center space-y-3 bg-white rounded-xl shadow-sm border p-8">
                <AlertCircle className="size-10 mx-auto text-amber-500" />
                <h1 className="text-lg font-semibold">Workspace session not found</h1>
                <p className="text-sm text-muted-foreground">
                    Please open your garage from the SaaS dashboard to get a fresh handoff link.
                </p>
                <Link
                    href={fallbackUrl}
                    className="inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm border bg-white hover:bg-muted/40 transition"
                >
                    <ExternalLink className="size-3.5" />
                    Back to SaaS dashboard
                </Link>
            </div>
        </div>
    )
}
