5 lines
901 B
TypeScript
5 lines
901 B
TypeScript
"use client";
|
|
import Link from "next/link";import {usePathname} from "next/navigation";import {useState} from "react";
|
|
const links=[["/","Home"],["/advantages","Why Us"],["/process","How It Works"],["/cases","Scenarios"],["/faq","FAQ"],["/contact","Contact"]];
|
|
export function SiteNav(){const path=usePathname();const [open,setOpen]=useState(false);return <header><div className="shell nav"><Link className="brand" href="/" onClick={()=>setOpen(false)}>COZ<span>CREATOR</span></Link><button className="menu" type="button" aria-label={open?"Close navigation":"Open navigation"} aria-expanded={open} onClick={()=>setOpen(!open)}><i/><i/></button><nav className={open?"open":""}>{links.map(([href,label])=><Link className={path===href?"active":""} href={href} key={href} onClick={()=>setOpen(false)}>{label}</Link>)}<Link className="nav-cta" href="/contact">Become a Partner</Link></nav></div></header>}
|