|
1
|
import { clx } from "@medusajs/ui" |
|
2
|
import { ComponentPropsWithoutRef } from "react" |
|
3
|
import { Link } from "react-router-dom" |
|
4
|
|
|
5
|
interface LinkButtonProps extends ComponentPropsWithoutRef<typeof Link> { |
|
6
|
variant?: "primary" | "interactive" |
|
7
|
} |
|
8
|
|
|
9
|
export const LinkButton = ({ |
|
10
|
className, |
|
11
|
variant = "interactive", |
|
12
|
...props |
|
13
|
}: LinkButtonProps) => { |
|
14
|
return ( |
|
15
|
<Link |
|
16
|
className={clx( |
|
17
|
"transition-fg txt-compact-small-plus rounded-[4px] outline-none", |
|
18
|
"focus-visible:shadow-borders-focus", |
|
19
|
{ |
|
20
|
"text-ui-fg-interactive hover:text-ui-fg-interactive-hover": |
|
21
|
variant === "interactive", |
|
22
|
"text-ui-fg-base hover:text-ui-fg-subtle": variant === "primary", |
|
23
|
}, |
|
24
|
className |
|
25
|
)} |
|
26
|
{...props} |
|
27
|
/> |
|
28
|
) |
|
29
|
} |