forked from dair-ai/Prompt-Engineering-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.tsx
More file actions
40 lines (38 loc) · 938 Bytes
/
button.tsx
File metadata and controls
40 lines (38 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import cn from 'clsx'
import type { ReactNode, ReactElement } from 'react'
interface ButtonProps {
children?: ReactNode
className?: string
onClick?: () => void
type?: 'button' | 'submit' | 'reset'
disabled?: boolean
title?: string
tabIndex?: number
}
export const Button = ({
children,
className,
onClick,
type = 'button',
disabled,
title,
tabIndex
}: ButtonProps): ReactElement => {
return (
<button
type={type}
onClick={onClick}
disabled={disabled}
title={title}
tabIndex={tabIndex}
className={cn(
'nextra-button nx-transition-all active:nx-opacity-50',
'nx-bg-primary-700/5 nx-border nx-border-black/5 nx-text-gray-600 hover:nx-text-gray-900 nx-rounded-md nx-p-1.5',
'dark:nx-bg-primary-300/10 dark:nx-border-white/10 dark:nx-text-gray-400 dark:hover:nx-text-gray-50',
className
)}
>
{children}
</button>
)
}