Spaces:
Runtime error
Runtime error
Download frontend/src/components/chat/CollapsedSidebarRail.jsx from cuiconnect/backend: direct link, hf CLI and curl.
- Browser
- Download file 3.1 kB
-
https://huggingface.co/spaces/cuiconnect/backend/resolve/main/frontend/src/components/chat/CollapsedSidebarRail.jsx
- Command line
-
hf download hf://spaces/cuiconnect/backend/frontend/src/components/chat/CollapsedSidebarRail.jsx
-
curl -L -o CollapsedSidebarRail.jsx https://huggingface.co/spaces/cuiconnect/backend/resolve/main/frontend/src/components/chat/CollapsedSidebarRail.jsx
3.1 kB
| import ComsatsLogo from '../ComsatsLogo' | |
| function UserCircleIcon({ className = '' }) { | |
| return ( | |
| <svg className={className} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" aria-hidden> | |
| <path | |
| strokeLinecap="round" | |
| strokeLinejoin="round" | |
| d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" | |
| /> | |
| </svg> | |
| ) | |
| } | |
| function LogoutIcon({ className = '' }) { | |
| return ( | |
| <svg className={className} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" aria-hidden> | |
| <path | |
| strokeLinecap="round" | |
| strokeLinejoin="round" | |
| d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9" | |
| /> | |
| </svg> | |
| ) | |
| } | |
| export default function CollapsedSidebarRail({ onOpenSidebar, onEditProfile, onLogout }) { | |
| const railBtn = | |
| 'flex w-full flex-col items-center gap-1 rounded-xl px-1 py-2 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-comsats-blue focus-visible:ring-offset-1' | |
| return ( | |
| <aside | |
| className="hidden min-h-0 w-[84px] shrink-0 flex-col items-stretch border-r border-slate-200/70 bg-chat-sidebar px-1.5 py-3 shadow-[inset_-1px_0_0_rgba(0,0,0,0.04)] md:flex" | |
| aria-label="Collapsed sidebar" | |
| > | |
| <div className="flex flex-col items-center gap-2"> | |
| <button | |
| type="button" | |
| onClick={onOpenSidebar} | |
| aria-label="Open sidebar" | |
| title="Open chats" | |
| className="rounded-xl bg-white p-1 shadow-md shadow-slate-900/8 ring-1 ring-slate-200/85 transition-all hover:ring-comsats-purple/35" | |
| > | |
| <ComsatsLogo className="h-9 w-9" /> | |
| </button> | |
| <span className="max-w-full px-0.5 text-center text-[8px] font-semibold uppercase leading-tight tracking-wide text-slate-500"> | |
| Chats | |
| </span> | |
| <div className="h-px w-10 max-w-full shrink-0 bg-slate-200/90" aria-hidden /> | |
| </div> | |
| <div className="min-h-0 flex-1" aria-hidden /> | |
| <div className="flex flex-col items-stretch gap-2 pb-1"> | |
| <button | |
| type="button" | |
| onClick={onEditProfile} | |
| aria-label="Edit profile" | |
| title="Edit profile" | |
| className={`${railBtn} text-slate-700 hover:bg-white/90 hover:text-comsats-purple`} | |
| > | |
| <UserCircleIcon className="h-5 w-5 shrink-0 text-slate-600" /> | |
| <span className="max-w-[4.75rem] text-center text-[8px] font-semibold leading-snug"> | |
| Edit profile | |
| </span> | |
| </button> | |
| <button | |
| type="button" | |
| onClick={onLogout} | |
| aria-label="Log out" | |
| title="Log out" | |
| className={`${railBtn} text-red-700 hover:bg-red-50`} | |
| > | |
| <LogoutIcon className="h-5 w-5 shrink-0" /> | |
| <span className="text-[9px] font-semibold leading-tight">Log out</span> | |
| </button> | |
| </div> | |
| </aside> | |
| ) | |
| } | |