@@ -5,34 +5,34 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
55import { BrowserRouter , Routes , Route , Navigate , useParams } from "react-router" ;
66import { AuthProvider , useAuth } from "./hooks/useAuth" ;
77import { TagsProvider } from "./contexts/TagsContext" ;
8- import { lazy , Suspense } from "react" ;
8+ import * as React from "react" ;
99
1010// Lazy-loaded components
11- const DashboardLayout = lazy ( ( ) => import ( "./components/layout/DashboardLayout" ) ) ;
12- const Dashboard = lazy ( ( ) => import ( "./pages/Dashboard" ) ) ;
13- const ProjectsPage = lazy ( ( ) => import ( "./pages/ProjectsPage" ) ) ;
14- const ProjectDetailPage = lazy ( ( ) => import ( "./pages/projects/ProjectDetailPage" ) ) ;
15- const AIToolsPage = lazy ( ( ) => import ( "./pages/AIToolsPage" ) ) ;
16- const ApplicationsPage = lazy ( ( ) => import ( "./pages/ApplicationsPage" ) ) ;
17- const ServersPage = lazy ( ( ) => import ( "./pages/ServersPage" ) ) ;
18- const ProfilePage = lazy ( ( ) => import ( "./pages/ProfilePage" ) ) ;
19- const LoginPage = lazy ( ( ) => import ( "./pages/auth/LoginPage" ) ) ;
20- const RegisterPage = lazy ( ( ) => import ( "./pages/auth/RegisterPage" ) ) ;
21- const NotFound = lazy ( ( ) => import ( "./pages/NotFound" ) ) ;
22- const LandingPage = lazy ( ( ) => import ( "./pages/LandingPage" ) ) ;
23- const OrganizationsPage = lazy ( ( ) => import ( "./pages/OrganizationsPage" ) ) ;
24- const OrganizationDetailPage = lazy ( ( ) => import ( "./pages/OrganizationDetailPage" ) ) ;
25-
26- const NewProjectPage = lazy ( ( ) => import ( "./pages/projects/NewProjectPage" ) ) ;
27- const NewApplicationPage = lazy ( ( ) => import ( "./pages/applications/NewApplicationPage" ) ) ;
28- const NewServerPage = lazy ( ( ) => import ( "./pages/servers/NewServerPage" ) ) ;
29- const NewToolPage = lazy ( ( ) => import ( "./pages/ai-tools/NewToolPage" ) ) ;
30-
31- const ApplicationDetailPage = lazy ( ( ) => import ( "./pages/applications/ApplicationDetailPage" ) ) ;
32- const ApiFormPage = lazy ( ( ) => import ( "./pages/applications/api/ApiFormPage" ) ) ;
33- const ServiceFormPage = lazy ( ( ) => import ( "./pages/applications/service/ServiceFormPage" ) ) ;
34- const MessageFormPage = lazy ( ( ) => import ( "./pages/applications/message/MessageFormPage" ) ) ;
35- const ServerDetailPage = lazy ( ( ) => import ( "./pages/servers/ServerDetailPage" ) ) ;
11+ const DashboardLayout = React . lazy ( ( ) => import ( "./components/layout/DashboardLayout" ) ) ;
12+ const Dashboard = React . lazy ( ( ) => import ( "./pages/Dashboard" ) ) ;
13+ const ProjectsPage = React . lazy ( ( ) => import ( "./pages/ProjectsPage" ) ) ;
14+ const ProjectDetailPage = React . lazy ( ( ) => import ( "./pages/projects/ProjectDetailPage" ) ) ;
15+ const AIToolsPage = React . lazy ( ( ) => import ( "./pages/AIToolsPage" ) ) ;
16+ const ApplicationsPage = React . lazy ( ( ) => import ( "./pages/ApplicationsPage" ) ) ;
17+ const ServersPage = React . lazy ( ( ) => import ( "./pages/ServersPage" ) ) ;
18+ const ProfilePage = React . lazy ( ( ) => import ( "./pages/ProfilePage" ) ) ;
19+ const LoginPage = React . lazy ( ( ) => import ( "./pages/auth/LoginPage" ) ) ;
20+ const RegisterPage = React . lazy ( ( ) => import ( "./pages/auth/RegisterPage" ) ) ;
21+ const NotFound = React . lazy ( ( ) => import ( "./pages/NotFound" ) ) ;
22+ const LandingPage = React . lazy ( ( ) => import ( "./pages/LandingPage" ) ) ;
23+ const OrganizationsPage = React . lazy ( ( ) => import ( "./pages/OrganizationsPage" ) ) ;
24+ const OrganizationDetailPage = React . lazy ( ( ) => import ( "./pages/OrganizationDetailPage" ) ) ;
25+
26+ const NewProjectPage = React . lazy ( ( ) => import ( "./pages/projects/NewProjectPage" ) ) ;
27+ const NewApplicationPage = React . lazy ( ( ) => import ( "./pages/applications/NewApplicationPage" ) ) ;
28+ const NewServerPage = React . lazy ( ( ) => import ( "./pages/servers/NewServerPage" ) ) ;
29+ const NewToolPage = React . lazy ( ( ) => import ( "./pages/ai-tools/NewToolPage" ) ) ;
30+
31+ const ApplicationDetailPage = React . lazy ( ( ) => import ( "./pages/applications/ApplicationDetailPage" ) ) ;
32+ const ApiFormPage = React . lazy ( ( ) => import ( "./pages/applications/api/ApiFormPage" ) ) ;
33+ const ServiceFormPage = React . lazy ( ( ) => import ( "./pages/applications/service/ServiceFormPage" ) ) ;
34+ const MessageFormPage = React . lazy ( ( ) => import ( "./pages/applications/message/MessageFormPage" ) ) ;
35+ const ServerDetailPage = React . lazy ( ( ) => import ( "./pages/servers/ServerDetailPage" ) ) ;
3636
3737const queryClient = new QueryClient ( {
3838 defaultOptions : {
@@ -44,7 +44,7 @@ const queryClient = new QueryClient({
4444} ) ;
4545
4646const AuthenticatedRoute = ( { children } : { children : React . ReactNode } ) => {
47- const { session , loading } = useAuth ( ) ;
47+ const { user , loading } = useAuth ( ) ;
4848
4949 if ( loading ) {
5050 return < div className = "flex h-screen w-full items-center justify-center" > Loading...</ div > ;
@@ -54,13 +54,13 @@ const AuthenticatedRoute = ({ children }: { children: React.ReactNode }) => {
5454} ;
5555
5656const RedirectIfAuthenticated = ( { children } : { children : React . ReactNode } ) => {
57- const { session , loading } = useAuth ( ) ;
57+ const { user , loading } = useAuth ( ) ;
5858
5959 if ( loading ) {
6060 return < div className = "flex h-screen w-full items-center justify-center" > Loading...</ div > ;
6161 }
6262
63- if ( session . user ) {
63+ if ( user ) {
6464 return < Navigate to = "/" replace /> ;
6565 }
6666
@@ -82,9 +82,9 @@ const RedirectWithSlug: React.FC<RedirectWithSlugProps> = ({ path }) => {
8282} ;
8383
8484const AppRoutes = ( ) => {
85- const { session } = useAuth ( ) ;
85+ const { user } = useAuth ( ) ;
8686
87- if ( ! session . user && window . location . pathname === '/' ) {
87+ if ( ! user && window . location . pathname === '/' ) {
8888 return (
8989 < Routes >
9090 < Route element = { < DashboardLayout /> } >
@@ -182,9 +182,9 @@ const App = () => {
182182 < BrowserRouter >
183183 < AuthProvider >
184184 < TagsProvider >
185- < Suspense fallback = { < div className = "flex h-screen w-full items-center justify-center" > Loading...</ div > } >
185+ < React . Suspense fallback = { < div className = "flex h-screen w-full items-center justify-center" > Loading...</ div > } >
186186 < AppRoutes />
187- </ Suspense >
187+ </ React . Suspense >
188188 </ TagsProvider >
189189 </ AuthProvider >
190190 </ BrowserRouter >
0 commit comments