Spaces:
Running
Running
Download src/components/AppHeader.tsx from suplo6669/sharpify-ai: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/spaces/suplo6669/sharpify-ai/resolve/main/src/components/AppHeader.tsx
- Command line
-
hf download hf://spaces/suplo6669/sharpify-ai/src/components/AppHeader.tsx
-
curl -L -o AppHeader.tsx https://huggingface.co/spaces/suplo6669/sharpify-ai/resolve/main/src/components/AppHeader.tsx
1.66 kB
| "use client"; | |
| import { ArrowUpRight, LogIn, LogOut, Sparkles } from "lucide-react"; | |
| import { useHfOAuth } from "@/components/HfOAuthProvider"; | |
| export function AppHeader() { | |
| const auth = useHfOAuth(); | |
| return ( | |
| <header className="site-header"> | |
| <a className="brand-lockup" href="#top" aria-label="Sharpify AI home"> | |
| <span className="brand-mark"><Sparkles size={16} strokeWidth={2.2} /></span> | |
| <span>sharpify<span className="brand-ai">.ai</span></span> | |
| </a> | |
| <nav className="main-nav" aria-label="Main navigation"> | |
| <a href="#studio">Enhance</a> | |
| <a href="#how-it-works">How it works</a> | |
| <a href="#about">About</a> | |
| </nav> | |
| <div className="header-actions"> | |
| {auth.required && ( | |
| <div className="header-auth-wrap"> | |
| <button | |
| className="header-cta header-auth-button" | |
| type="button" | |
| disabled={!auth.ready || auth.isSigningIn} | |
| onClick={() => { | |
| if (auth.accessToken) auth.signOut(); | |
| else void auth.signIn(); | |
| }} | |
| > | |
| {auth.accessToken ? <LogOut size={14} /> : <LogIn size={14} />} | |
| <span>{!auth.ready ? "Checking sign-in…" : auth.isSigningIn ? "Connecting…" : auth.accessToken ? `@${auth.username ?? "signed in"} · Sign out` : "Sign in with HF"}</span> | |
| </button> | |
| {auth.error && <span className="header-auth-error" role="status">{auth.error}</span>} | |
| </div> | |
| )} | |
| <a className="header-cta" href="#studio">Open studio <ArrowUpRight size={15} /></a> | |
| </div> | |
| </header> | |
| ); | |
| } | |