Spaces:
Sleeping
Sleeping
Download components/ClientChatWidgetWrapper.tsx from Tahasaif3/taskflow-frontend: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/spaces/Tahasaif3/taskflow-frontend/resolve/main/components/ClientChatWidgetWrapper.tsx
- Command line
-
hf download hf://spaces/Tahasaif3/taskflow-frontend/components/ClientChatWidgetWrapper.tsx
-
curl -L -o ClientChatWidgetWrapper.tsx https://huggingface.co/spaces/Tahasaif3/taskflow-frontend/resolve/main/components/ClientChatWidgetWrapper.tsx
669 Bytes
| 'use client'; | |
| import { useUser } from '@/components/UserProvider'; | |
| import FloatingChatWidget from '@/components/FloatingChatWidget'; | |
| import { usePathname } from 'next/navigation'; | |
| export default function ClientChatWidgetWrapper() { | |
| const { userId, loading } = useUser(); | |
| const pathname = usePathname(); | |
| // Routes where the chat widget should be hidden | |
| const hiddenRoutes = ['/', '/login', '/register', '/forgot-password', '/reset-password']; | |
| if (loading || !userId || hiddenRoutes.includes(pathname)) { | |
| return null; // Don't show chat widget while loading, if not logged in, or on specific pages | |
| } | |
| return <FloatingChatWidget userId={userId} />; | |
| } |