Download src/components/header.tsx from linuxrun/convert: direct link, hf CLI and curl.
- Browser
- Download file 2.38 kB
-
https://huggingface.co/spaces/linuxrun/convert/resolve/main/src/components/header.tsx
- Command line
-
hf download hf://spaces/linuxrun/convert/src/components/header.tsx
-
curl -L -o header.tsx https://huggingface.co/spaces/linuxrun/convert/resolve/main/src/components/header.tsx
2.38 kB
| export const Header = ({ | |
| loggedIn, | |
| accountRegistration, | |
| allowUnauthenticated, | |
| hideHistory, | |
| webroot = "", | |
| }: { | |
| loggedIn?: boolean; | |
| accountRegistration?: boolean; | |
| allowUnauthenticated?: boolean; | |
| hideHistory?: boolean; | |
| webroot?: string; | |
| }) => { | |
| let rightNav: JSX.Element; | |
| if (loggedIn) { | |
| rightNav = ( | |
| <ul class="flex gap-4"> | |
| {!hideHistory && ( | |
| <li> | |
| <a | |
| class={` | |
| text-accent-600 transition-all | |
| hover:text-accent-500 hover:underline | |
| `} | |
| href={`${webroot}/history`} | |
| > | |
| History | |
| </a> | |
| </li> | |
| )} | |
| {!allowUnauthenticated ? ( | |
| <li> | |
| <a | |
| class={` | |
| text-accent-600 transition-all | |
| hover:text-accent-500 hover:underline | |
| `} | |
| href={`${webroot}/account`} | |
| > | |
| Account | |
| </a> | |
| </li> | |
| ) : null} | |
| {!allowUnauthenticated ? ( | |
| <li> | |
| <a | |
| class={` | |
| text-accent-600 transition-all | |
| hover:text-accent-500 hover:underline | |
| `} | |
| href={`${webroot}/logoff`} | |
| > | |
| Logout | |
| </a> | |
| </li> | |
| ) : null} | |
| </ul> | |
| ); | |
| } else { | |
| rightNav = ( | |
| <ul class="flex gap-4"> | |
| <li> | |
| <a | |
| class={` | |
| text-accent-600 transition-all | |
| hover:text-accent-500 hover:underline | |
| `} | |
| href={`${webroot}/login`} | |
| > | |
| Login | |
| </a> | |
| </li> | |
| {accountRegistration ? ( | |
| <li> | |
| <a | |
| class={` | |
| text-accent-600 transition-all | |
| hover:text-accent-500 hover:underline | |
| `} | |
| href={`${webroot}/register`} | |
| > | |
| Register | |
| </a> | |
| </li> | |
| ) : null} | |
| </ul> | |
| ); | |
| } | |
| return ( | |
| <header class="w-full p-4"> | |
| <nav class={`mx-auto flex max-w-4xl justify-between rounded-sm bg-neutral-900 p-4`}> | |
| <ul> | |
| <li> | |
| <strong> | |
| <a href={`${webroot}/`}>ConvertX</a> | |
| </strong> | |
| </li> | |
| </ul> | |
| {rightNav} | |
| </nav> | |
| </header> | |
| ); | |
| }; | |