import React, { useEffect, useState } from 'react'; import { BrowserRouter, Routes, Route, Navigate, useLocation } from 'react-router-dom'; import Login from './components/Login'; import './App.css'; // Protected Route wrapper function RequireAuth({ children }: { children: React.ReactElement }) { const [auth, setAuth] = useState(null); const location = useLocation(); useEffect(() => { fetch('/api/auth') .then((res) => { if (res.ok) { setAuth(true); } else { setAuth(false); } }) .catch(() => setAuth(false)); }, []); if (auth === null) { return
Loading...
; } if (!auth) { return ; } return children; } function Dashboard() { // Placeholder for now return (

Dashboard

Welcome to the new Neko/v2 frontend.

) } function App() { return ( } /> } /> ); } export default App;