import React from "react"; import { BrowserRouter as Router, Routes, Route } from "react-router"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { Toaster } from "@/components/ui/sonner"; import { ThemeProvider } from "@/components/theme-provider"; import AppLayout from "@/components/layout/AppLayout"; import LoginPage from "@/pages/LoginPage"; import ChatPage from "@/pages/ChatPage"; import SettingsPage from "@/pages/SettingsPage"; import NotFoundPage from "@/pages/NotFoundPage"; // import { useAuthStore } from "@/stores/authStore"; // import { useUiStore } from "@/stores/uiStore"; import ErrorBoundary from "@/components/common/ErrorBoundary"; import { Home } from "lucide-react"; // Create a client const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: 1000 * 60 * 5, // 5 minutes refetchOnWindowFocus: false, retry: (failureCount, error: any) => { if (error?.status === 401) return false; return failureCount < 3; }, }, }, }); // Protected Route wrapper const ProtectedRoute: React.FC<{ children: React.ReactNode }> = ({ children, }) => { // const { isAuthenticated } = useAuthStore(); // if (!isAuthenticated) { // return ; // } return <>{children}; }; // Home page component - shows server selection const HomePage: React.FC = () => { return (

Welcome to Concord

Select a server from the sidebar to start chatting, or create a new server

); }; function App() { return (
{/* Auth routes */} } /> {/* Protected routes with layout */} } > {/* Default redirect to home */} } /> {/* Server and channel routes */} } /> } /> {/* Settings */} } /> } /> {/* 404 */} } />
{import.meta.env.DEV === true && } {/* Toast notifications */}
); } export default App;