import React from "react"; import { ExclamationTriangleIcon } from "@heroicons/react/24/solid"; import { ArrowPathIcon, ArrowRightIcon } from "@heroicons/react/16/solid"; import { motion, AnimatePresence } from "framer-motion"; import { LuPlay } from "react-icons/lu"; import { Button, LinkButton } from "@components/Button"; import LoadingSpinner from "@components/LoadingSpinner"; import Card, { GridCard } from "@components/Card"; interface OverlayContentProps { children: React.ReactNode; } function OverlayContent({ children }: OverlayContentProps) { return ( {children} ); } interface LoadingOverlayProps { show: boolean; } export function LoadingVideoOverlay({ show }: LoadingOverlayProps) { return ( {show && ( Loading video stream... )} ); } interface LoadingConnectionOverlayProps { show: boolean; text: string; } export function LoadingConnectionOverlay({ show, text }: LoadingConnectionOverlayProps) { return ( {show && ( {text} )} ); } interface ConnectionErrorOverlayProps { show: boolean; setupPeerConnection: () => Promise; } export function ConnectionFailedOverlay({ show, setupPeerConnection, }: ConnectionErrorOverlayProps) { return ( {show && ( Connection Issue Detected Verify that the device is powered on and properly connected Check all cable connections for any loose or damaged wires Ensure your network connection is stable and active Try restarting both the device and your computer setupPeerConnection()} LeadingIcon={ArrowPathIcon} text="Try again" size="SM" theme="light" /> )} ); } interface PeerConnectionDisconnectedOverlay { show: boolean; } export function PeerConnectionDisconnectedOverlay({ show, }: PeerConnectionDisconnectedOverlay) { return ( {show && ( Connection Issue Detected Verify that the device is powered on and properly connected Check all cable connections for any loose or damaged wires Ensure your network connection is stable and active Try restarting both the device and your computer Retrying connection... )} ); } interface HDMIErrorOverlayProps { show: boolean; hdmiState: string; } export function HDMIErrorOverlay({ show, hdmiState }: HDMIErrorOverlayProps) { const isNoSignal = hdmiState === "no_signal"; const isOtherError = hdmiState === "no_lock" || hdmiState === "out_of_range"; return ( <> {show && isNoSignal && ( No HDMI signal detected. Ensure the HDMI cable securely connected at both ends Ensure source device is powered on and outputting a signal If using an adapter, it's compatible and functioning correctly )} {show && isOtherError && ( HDMI signal error detected. A loose or faulty HDMI connection Incompatible resolution or refresh rate settings Issues with the source device's HDMI output )} > ); } interface NoAutoplayPermissionsOverlayProps { show: boolean; onPlayClick: () => void; } export function NoAutoplayPermissionsOverlay({ show, onPlayClick, }: NoAutoplayPermissionsOverlayProps) { return ( {show && ( Autoplay permissions required Please adjust browser settings to enable autoplay )} ); }
Loading video stream...
{text}
Retrying connection...