Chatbot Page¶
The Chatbot page provides a dedicated interface for users to interact with the BidScript chatbot functionality.
Overview¶
The Chatbot page presents a minimalist interface with the ChatbotSidebar component, providing users with a focused environment for interacting with the AI chatbot. This page is protected and requires authentication to access.
Features¶
- Protected route (redirects to login if not authenticated)
- Full-screen interface with chatbot sidebar
- Session-based authentication verification
State Management¶
The page uses:
- Next.js session management via
useSessionhook - Loading state management via
useLoadingcontext
Key Methods¶
| Method | Description |
|---|---|
useEffect |
Handles authentication checking and redirect logic |
HTML Structure¶
Components Used¶
| Component | Purpose |
|---|---|
ChatbotSidebar |
Main component that provides the chatbot interface |
LoadingOverlay |
Global loading indicator (indirectly via context) |
API Routes Used¶
- No direct API calls in this component
- Authentication handled by Next.js auth
- Actual API calls are made from the ChatbotSidebar component
Route¶
/chatbot
Dependencies¶
next-auth/react: For session managementnext/router: For navigation and redirection@/components/ChatbotSidebar: Main chatbot interface@/components/LoadingContext: For loading state management
Notes¶
- The page has a minimalist design, delegating most functionality to the ChatbotSidebar component
- The global loading overlay is shown when checking authentication status
- This page requires authentication to access and will redirect unauthenticated users to the login page