"use client"; import { useState } from "react"; /** * Banner that displays when the backend is unavailable. * Shows error message, countdown to next retry, and manual retry button. * * NOTE: Integrate with actual backend status checking hook (see issue #TBD) */ export function BackendStatusBanner() { const [isAvailable, _setIsAvailable] = useState(true); const [_error, _setError] = useState(null); const [_retryIn, _setRetryIn] = useState(0); // NOTE: Replace with actual useBackendStatus hook (see issue #TBD) // const { isAvailable, error, retryIn, manualRetry } = useBackendStatus(); const manualRetry = () => { // NOTE: Implement manual retry logic (see issue #TBD) void 0; // Placeholder until implemented }; const handleSignOut = (): void => { try { // NOTE: Implement signOut (see issue #TBD) // await signOut(); } catch (error) { // Silently fail - will redirect anyway void error; } window.location.href = "/login"; }; // Don't render if backend is available if (isAvailable) { return null; } return (
{_error || "Backend temporarily unavailable."} {_retryIn > 0 && Retrying in {_retryIn}s...}
); }