Newer
Older
"use client"
import { Icons } from "@/components/icons"
import { SidebarNavItem } from "@/types"
import { User } from "next-auth"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { Button } from "./ui/button"
export const MobileNav = ({ items, user }: { items: SidebarNavItem[], user: User | undefined }) => {
const path = usePathname()
if (!items?.length) {
return null
}
<nav className={`container flex flex-row items-center h-full w-full max-w-lg justify-between mx-auto`}>
{visibleItems.map((item, index) => {
const Icon = Icons[item.icon || "arrowRight"]
if (item.title === "My Profile") {
item.href = `/${user?.username}`
}
<Link key={index} href={item.disabled ? "/" : item.href} className="inline-flex items-center justify-center w-full h-full">