import { createFileRoute } from "@tanstack/react-router"; import { useState, useEffect } from "react"; import { apiClient, type HealthResponse, type StatusResponse, } from "../lib/api"; import logo from "../logo.svg"; import "../App.css"; export const Route = createFileRoute("/")({ component: App, }); function App() { const [health, setHealth] = useState(null); const [status, setStatus] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { const fetchData = async () => { try { setLoading(true); const [healthData, statusData] = await Promise.all([ apiClient.getHealth(), apiClient.getStatus(), ]); setHealth(healthData); setStatus(statusData); setError(null); } catch (err) { setError(err instanceof Error ? err.message : "Failed to fetch data"); } finally { setLoading(false); } }; fetchData(); }, []); return (
logo

Banner Discord Bot Dashboard

{loading &&

Loading...

} {error && (

Error: {error}

)} {health && (

Health Status

Status: {health.status}

Timestamp: {new Date(health.timestamp).toLocaleString()}

)} {status && (

System Status

Overall: {status.status}

Bot: {status.bot.status}

Cache: {status.cache.status}

Banner API: {status.banner_api.status}

)}
); }