Spaces:
Sleeping
Sleeping
Download src/components/layout/MainLayout.tsx from sarveshpatel/MPEDA: direct link, hf CLI and curl.
- Browser
- Download file 826 Bytes
-
https://huggingface.co/spaces/sarveshpatel/MPEDA/resolve/main/src/components/layout/MainLayout.tsx
- Command line
-
hf download hf://spaces/sarveshpatel/MPEDA/src/components/layout/MainLayout.tsx
-
curl -L -o MainLayout.tsx https://huggingface.co/spaces/sarveshpatel/MPEDA/resolve/main/src/components/layout/MainLayout.tsx
826 Bytes
| import { Outlet } from 'react-router-dom'; | |
| import { Sidebar } from './Sidebar'; | |
| import { Header } from './Header'; | |
| import { useState } from 'react'; | |
| import { useIsMobile } from '@/hooks/use-mobile'; | |
| import { cn } from '@/lib/utils'; | |
| export function MainLayout() { | |
| const [mobileMenuOpen, setMobileMenuOpen] = useState(false); | |
| const isMobile = useIsMobile(); | |
| return ( | |
| <div className="min-h-screen bg-background"> | |
| <Sidebar | |
| mobileOpen={mobileMenuOpen} | |
| onMobileClose={() => setMobileMenuOpen(false)} | |
| /> | |
| <div className={cn( | |
| 'transition-all duration-300', | |
| isMobile ? 'pl-0' : 'pl-64' | |
| )}> | |
| <Header onMobileMenuOpen={() => setMobileMenuOpen(true)} /> | |
| <main className="p-4 md:p-6"> | |
| <Outlet /> | |
| </main> | |
| </div> | |
| </div> | |
| ); | |
| } | |