qazaq-legacy-foundation-web/src/components/Header.tsx
Peppa ab5a495f2f
Some checks failed
peppa/install install: failure за 0с
ci / checks (pull_request) Failing after 3s
deploy / deploy (pull_request) Successful in 1m46s
QLFW-4: главная страница фонда (Next.js, Tailwind, Payload)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 15:35:52 +05:00

35 lines
1.5 KiB
TypeScript

import Link from 'next/link'
import { locales, type Dict, type Locale } from '@/i18n'
export function Header({ t, locale, showProjects, showNews }: { t: Dict; locale: Locale; showProjects: boolean; showNews: boolean }) {
const links = [
['#mission', t.nav.mission, true],
['#directions', t.nav.directions, true],
['#projects', t.nav.projects, showProjects],
['#news', t.nav.news, showNews],
['#collaboration', t.nav.collaboration, true],
] as const
return (
<header className="absolute inset-x-0 top-0 z-10">
<div className="mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-x-8 gap-y-3 px-5 py-6 sm:px-8">
<Link href={`/${locale}`} className="font-serif text-lg tracking-wide">
{t.siteName}
</Link>
<nav className="order-3 flex w-full flex-wrap gap-x-6 gap-y-2 text-sm text-muted md:order-2 md:w-auto">
{links.filter((l) => l[2]).map(([href, label]) => (
<a key={href} href={href} className="hover:text-burgundy">{label}</a>
))}
</nav>
<div className="order-2 flex gap-3 text-sm md:order-3" aria-label={t.language}>
{locales.map((l) => (
<Link key={l} href={`/${l}`} hrefLang={l} aria-current={l === locale ? 'true' : undefined}
className={l === locale ? 'font-semibold text-burgundy' : 'text-muted hover:text-burgundy'}>
{l.toUpperCase()}
</Link>
))}
</div>
</div>
</header>
)
}