forked from sparckles/Robyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.jsx
More file actions
23 lines (20 loc) · 758 Bytes
/
Copy pathButton.jsx
File metadata and controls
23 lines (20 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Link from 'next/link'
import clsx from 'clsx'
const variantStyles = {
primary:
'font-semibold text-zinc-100 bg-zinc-700 hover:bg-zinc-600 active:bg-zinc-700 active:text-zinc-100/70',
secondary:
'font-medium bg-zinc-800/50 text-zinc-300 hover:bg-zinc-800 hover:text-zinc-50 active:bg-zinc-800/50 active:text-zinc-50/70',
}
export function Button({ variant = 'primary', className, href, ...props }) {
className = clsx(
'inline-flex items-center gap-2 justify-center rounded-md py-2 px-3 text-sm outline-offset-2 transition active:transition-none',
variantStyles[variant],
className
)
return href ? (
<Link href={href} className={className} {...props} />
) : (
<button className={className} {...props} />
)
}