Spaces:
Sleeping
Sleeping
Download src/components/chat/ChatShell.tsx from shahzaib24681012/teamsync: direct link, hf CLI and curl.
- Browser
- Download file 1.89 kB
-
https://huggingface.co/spaces/shahzaib24681012/teamsync/resolve/main/src/components/chat/ChatShell.tsx
- Command line
-
hf download hf://spaces/shahzaib24681012/teamsync/src/components/chat/ChatShell.tsx
-
curl -L -o ChatShell.tsx https://huggingface.co/spaces/shahzaib24681012/teamsync/resolve/main/src/components/chat/ChatShell.tsx
1.89 kB
| 'use client'; | |
| /** Chat screen layout: RoomsPanel (Hubs & People) beside the conversation card. */ | |
| import { ReactNode, useState } from 'react'; | |
| import { PanelLeft, X } from 'lucide-react'; | |
| import RoomsPanel from '../Sidebar'; | |
| export default function ChatShell({ children, landing = false }: { children: ReactNode; landing?: boolean }) { | |
| const [drawer, setDrawer] = useState(false); | |
| return ( | |
| <div className="flex h-full gap-3 p-2.5 md:p-3.5"> | |
| {/* desktop rooms */} | |
| <div className="hidden md:block"> | |
| <RoomsPanel /> | |
| </div> | |
| {/* mobile: on the landing page show rooms inline; elsewhere a drawer */} | |
| {landing ? ( | |
| <div className="block w-full md:hidden"> | |
| <RoomsPanel /> | |
| </div> | |
| ) : ( | |
| <> | |
| <button | |
| onClick={() => setDrawer(true)} | |
| className="grad fixed bottom-[84px] left-4 z-30 flex h-11 w-11 items-center justify-center rounded-full text-white shadow-pop md:hidden" | |
| aria-label="Open hubs and people" | |
| > | |
| <PanelLeft className="h-5 w-5" /> | |
| </button> | |
| {drawer && ( | |
| <div className="fixed inset-0 z-40 md:hidden"> | |
| <div className="absolute inset-0 bg-black/40" onClick={() => setDrawer(false)} /> | |
| <div className="absolute inset-y-2 left-2 flex" onClick={() => setDrawer(false)}> | |
| <RoomsPanel onNavigate={() => setDrawer(false)} /> | |
| </div> | |
| <button onClick={() => setDrawer(false)} className="absolute right-4 top-4 rounded-full bg-white p-2 shadow-pop" aria-label="Close"> | |
| <X className="h-4 w-4" /> | |
| </button> | |
| </div> | |
| )} | |
| </> | |
| )} | |
| <div className={`panel min-h-0 min-w-0 flex-1 overflow-hidden ${landing ? 'hidden md:block' : ''}`}> | |
| {children} | |
| </div> | |
| </div> | |
| ); | |
| } | |