import Link from "next/link" import { navLinkStyle } from "./Styles" import { useRouter } from "next/router" import { CodepenIcon, TwitterIcon, GithubIcon, ReadmeIcon, TimelineIcon, PencilIcon, ListIcon } from "assets/Icons" import { ReactNode } from "react" const nav = [ { name: "Timline", src: "timeline", icon: () }, { name: "Writing", slug: "writing", icon: () }, { name: "Lists", slug: "list", icon: () }, ] const projects = [ { name: "Design Docs", slug: "design-docs", url: "https://designdocs.co/", }, ] const social = [ { name: "Github", url: "https://github.com/iamnbutler/", icon: () }, { name: "Twitter", url: "https://twitter.com/iamnbutler", icon: () }, { name: "Codepen", url: "https://codepen.io/iamnbutler", icon: () }, { name: "Read.cv", url: "https://read.cv/natebutler", icon: () } ] interface NavLink { name: string slug?: string url?: string icon?: ReactNode } interface NavLinkItemProps { link: NavLink } /** * Build nav link items. * If a `url` isn't passed, use `slug` to create an link **/ function NavLinkItem({ link }: NavLinkItemProps) { let href = "" link.url ? (href = link.url) : (href = `/${link.slug}`) let current = false let currentPath = useRouter().asPath if (currentPath.includes(href)) { current = true } return ( {link.icon && {link.icon}} {link.name} ) } export default function Navigation() { return ( ) }