40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import { Link, useLocation } from "react-router";
|
|
|
|
import { Logo } from "@/components/site/Logo";
|
|
import { LocaleSwitcher } from "@/components/site/LocaleSwitcher";
|
|
import { useI18n } from "@/lib/i18n";
|
|
|
|
/**
|
|
* Header: โลโก้ชิดซ้าย · ด้านขวาเป็น [เกี่ยวกับเรา] + [ปุ่มภาษา TH/EN]
|
|
* ไม่มีเมนู "หน้าแรก" — กลับหน้าแรกได้ด้วยการกดโลโก้
|
|
*/
|
|
export function SiteHeader() {
|
|
const { messages } = useI18n();
|
|
const { pathname } = useLocation();
|
|
const isAbout = pathname.startsWith("/about");
|
|
|
|
return (
|
|
<header className="relative z-10 mx-auto flex h-[68px] w-full max-w-[1440px] items-center justify-between gap-4 px-5 md:px-[108px]">
|
|
<Link to="/" aria-label={`AlterFlixHub — ${messages.nav.home}`} className="shrink-0">
|
|
<Logo />
|
|
</Link>
|
|
|
|
<div className="flex items-center gap-1.5 sm:gap-2">
|
|
<Link
|
|
to="/about"
|
|
aria-current={isAbout ? "page" : undefined}
|
|
className={`rounded-lg border px-2 py-1 text-xs transition sm:px-3 sm:py-1.5 sm:text-sm ${
|
|
isAbout
|
|
? "border-[#A92626] bg-[#8F0808]/20 text-white"
|
|
: "border-[#303030] text-[#B3B3B3] hover:border-[#A92626]/60 hover:text-white"
|
|
}`}
|
|
>
|
|
{messages.nav.about}
|
|
</Link>
|
|
|
|
<LocaleSwitcher />
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|