Spaces:
Configuration error
Configuration error
Download src/components/layout/MenuLayout.tsx from SreejithSHR/umami: direct link, hf CLI and curl.
- Browser
- Download file 731 Bytes
-
https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/layout/MenuLayout.tsx
- Command line
-
hf download hf://spaces/SreejithSHR/umami/src/components/layout/MenuLayout.tsx
-
curl -L -o MenuLayout.tsx https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/src/components/layout/MenuLayout.tsx
731 Bytes
| import { ReactNode } from 'react'; | |
| import { usePathname } from 'next/navigation'; | |
| import SideNav from 'components/layout/SideNav'; | |
| import styles from './MenuLayout.module.css'; | |
| export function MenuLayout({ items = [], children }: { items: any[]; children: ReactNode }) { | |
| const pathname = usePathname(); | |
| const cloudMode = !!process.env.cloudMode; | |
| const getKey = () => items.find(({ url }) => pathname === url)?.key; | |
| return ( | |
| <div className={styles.layout}> | |
| {!cloudMode && ( | |
| <div className={styles.menu}> | |
| <SideNav items={items} shallow={true} selectedKey={getKey()} /> | |
| </div> | |
| )} | |
| <div className={styles.content}>{children}</div> | |
| </div> | |
| ); | |
| } | |
| export default MenuLayout; | |