/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
For commercial licensing, please contact support@quantumnous.com
*/
import React, { lazy, Suspense } from 'react';
import { Route, Routes, useLocation } from 'react-router-dom';
import Loading from './components/common/ui/Loading.js';
import User from './pages/User';
import { AuthRedirect, PrivateRoute } from './helpers';
import RegisterForm from './components/auth/RegisterForm.js';
import LoginForm from './components/auth/LoginForm.js';
import NotFound from './pages/NotFound';
import Setting from './pages/Setting';
import PasswordResetForm from './components/auth/PasswordResetForm.js';
import PasswordResetConfirm from './components/auth/PasswordResetConfirm.js';
import Channel from './pages/Channel';
import Token from './pages/Token';
import Redemption from './pages/Redemption';
import TopUp from './pages/TopUp';
import Log from './pages/Log';
import Chat from './pages/Chat';
import Chat2Link from './pages/Chat2Link';
import Midjourney from './pages/Midjourney';
import Pricing from './pages/Pricing/index.js';
import Task from './pages/Task/index.js';
import Playground from './pages/Playground/index.js';
import OAuth2Callback from './components/auth/OAuth2Callback.js';
import PersonalSetting from './components/settings/PersonalSetting.js';
import Setup from './pages/Setup/index.js';
import SetupCheck from './components/layout/SetupCheck.js';
const Home = lazy(() => import('./pages/Home'));
const Dashboard = lazy(() => import('./pages/Dashboard'));
const About = lazy(() => import('./pages/About'));
function App() {
const location = useLocation();
return (
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
} key={location.pathname}>
}
/>
{/* 方便使用chat2link直接跳转聊天... */}
} key={location.pathname}>
}
/>
} />
);
}
export default App;