mirror of
https://github.com/vercel/commerce.git
synced 2025-03-29 00:36:04 +00:00
39 lines
972 B
TypeScript
39 lines
972 B
TypeScript
import Link from 'next/link'
|
|
import s from './MenuSidebarView.module.css'
|
|
import { useUI } from '@components/ui/context'
|
|
import SidebarLayout from '@components/common/SidebarLayout'
|
|
import type { Link as LinkProps } from './index'
|
|
|
|
export default function MenuSidebarView({
|
|
links = [],
|
|
}: {
|
|
links?: LinkProps[]
|
|
}) {
|
|
const { closeSidebar } = useUI()
|
|
|
|
return (
|
|
<SidebarLayout handleClose={() => closeSidebar()}>
|
|
<div className={s.root}>
|
|
<nav>
|
|
<ul>
|
|
<li className={s.item} onClick={() => closeSidebar()}>
|
|
<Link href="/search">All</Link>
|
|
</li>
|
|
{links.map((l: any) => (
|
|
<li
|
|
key={l.href}
|
|
className={s.item}
|
|
onClick={() => closeSidebar()}
|
|
>
|
|
<Link href={l.href}>{l.label}</Link>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</SidebarLayout>
|
|
)
|
|
}
|
|
|
|
MenuSidebarView
|