diff --git a/src/components/StatusBar.tsx b/src/components/StatusBar.tsx new file mode 100644 index 0000000..c29fbbe --- /dev/null +++ b/src/components/StatusBar.tsx @@ -0,0 +1,50 @@ +import { AppStatus } from "../api"; + +interface Props { + status: AppStatus | null; + error: string | null; + loading: boolean; +} + +export function StatusBar({ status, error, loading }: Props) { + if (loading) { + return ( +
+ + Connecting to backend… +
+ ); + } + + if (error) { + return ( +
+ + Backend offline — {error} +
+ ); + } + + const vpnColor = status?.vpn_connected ? "bg-green-400" : "bg-yellow-400"; + const vpnLabel = status?.vpn_connected + ? `VPN · ${status.vpn_address}` + : "VPN · not connected"; + + return ( +
+ + + {vpnLabel} + + {status?.moonlight_path ? ( + + 🎮 {status.moonlight_path} + + ) : ( + + ⚠ Moonlight not found — install it and restart + + )} +
+ ); +}