MCPcopy
hub / github.com/alibaba/page-agent / Header

Function Header

packages/website/src/components/Header.tsx:13–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11import { HyperText } from './ui/hyper-text'
12
13export default function Header() {
14 const { isZh } = useLanguage()
15 const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
16 const stars = useGitHubStars()
17
18 return (
19 <>
20 <header
21 className="sticky top-0 z-50 bg-white/80 dark:bg-gray-900/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-700"
22 role="banner"
23 >
24 <div className="max-w-7xl mx-auto px-6 py-4">
25 <div className="flex items-center justify-between gap-2">
26 {/* Logo */}
27 <Link
28 href="/"
29 className="flex items-center gap-2 sm:gap-3 group shrink-0"
30 aria-label={isZh ? 'page-agent 首页' : 'page-agent home'}
31 onClick={() => setMobileMenuOpen(false)}
32 >
33 <img
34 src="https://img.alicdn.com/imgextra/i2/O1CN01HB8ylu1uozANEMZw2_!!6000000006085-49-tps-128-128.webp"
35 alt="PageAgent Logo"
36 className="w-10 h-10 rounded-xl group-hover:scale-110 transition-transform duration-200"
37 />
38 <div>
39 <span className="text-base sm:text-xl font-bold text-gray-900 dark:text-white leading-tight flex items-baseline gap-1.5">
40 page-agent
41 <span className="hidden sm:inline text-[10px] font-mono font-normal text-gray-400 dark:text-gray-500 tabular-nums before:content-['v']">
42 {import.meta.env.VERSION}
43 </span>
44 </span>
45 <HyperText
46 as="p"
47 className="hidden sm:block text-xs text-gray-600 dark:text-gray-300 py-0 font-normal overflow-visible"
48 duration={600}
49 animateOnHover={true}
50 aria-hidden="true"
51 >
52 AI Agent In Your Webpage
53 </HyperText>
54 </div>
55 </Link>
56
57 {/* Mobile Icon Navigation (横向滚动) */}
58 <nav
59 className="md:hidden flex items-center gap-1 overflow-x-auto scrollbar-hide flex-1"
60 role="navigation"
61 aria-label="Mobile navigation"
62 >
63 <Link
64 href="/docs/introduction/overview"
65 className="p-2 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 shrink-0"
66 aria-label={isZh ? '文档' : 'Docs'}
67 >
68 <BookOpen className="w-5 h-5" />
69 </Link>
70 <a

Callers

nothing calls this directly

Calls 3

useLanguageFunction · 0.90
useGitHubStarsFunction · 0.90
formatStarsFunction · 0.90

Tested by

no test coverage detected