import { Button } from "~/components/ui/button"; import { Card } from "~/components/ui/card"; interface ConnectionOverlayProps { isConnected: boolean; isReconnecting: boolean; connectionError: string | null; } export function ConnectionOverlay({ isConnected, isReconnecting, connectionError, }: ConnectionOverlayProps) { // Don't show overlay if connected if (isConnected) { return null; } return (
{/* Spinner or Error Icon */} {connectionError ? (
) : (
)} {/* Title */}

{connectionError ? "Connection Error" : isReconnecting ? "Reconnecting..." : "Connecting to Draft"}

{/* Message */}

{connectionError ? ( connectionError ) : isReconnecting ? ( "Lost connection to the draft server. Attempting to reconnect..." ) : ( "Please wait while we connect you to the live draft room." )}

{/* Action Button (only on persistent error) */} {connectionError && ( )} {/* Loading Dots */} {!connectionError && (
)}
); }