|
1
|
"use client" |
|
2
|
|
|
3
|
import React from "react" |
|
4
|
import { NavigationItemLink } from "types" |
|
5
|
import { LinkButton } from "../../../LinkButton" |
|
6
|
import clsx from "clsx" |
|
7
|
|
|
8
|
type MainNavItemLinkProps = { |
|
9
|
item: NavigationItemLink |
|
10
|
isActive: boolean |
|
11
|
icon?: React.ReactNode |
|
12
|
className?: string |
|
13
|
} |
|
14
|
|
|
15
|
export const MainNavItemLink = ({ |
|
16
|
item, |
|
17
|
isActive, |
|
18
|
icon, |
|
19
|
className, |
|
20
|
}: MainNavItemLinkProps) => { |
|
21
|
return ( |
|
22
|
<LinkButton |
|
23
|
href={item.link} |
|
24
|
className={clsx( |
|
25
|
"hover:bg-medusa-button-transparent-hover", |
|
26
|
"rounded-docs_sm px-docs_0.5 py-docs_0.25", |
|
27
|
className |
|
28
|
)} |
|
29
|
variant={isActive ? "base" : "subtle"} |
|
30
|
> |
|
31
|
{item.title} |
|
32
|
{icon} |
|
33
|
</LinkButton> |
|
34
|
) |
|
35
|
} |