Compare commits
1 Commits
main
...
general-bu
Author | SHA1 | Date | |
---|---|---|---|
|
c10ad31f11 |
|
@ -1,10 +1,7 @@
|
|||
import { ReactNode } from 'react'
|
||||
import clsx from 'clsx'
|
||||
|
||||
export function Button(props: {
|
||||
className?: string
|
||||
onClick?: () => void
|
||||
children?: ReactNode
|
||||
export function Button(
|
||||
props: {
|
||||
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
||||
color?:
|
||||
| 'green'
|
||||
|
@ -15,17 +12,14 @@ export function Button(props: {
|
|||
| 'gray'
|
||||
| 'gradient'
|
||||
| 'gray-white'
|
||||
type?: 'button' | 'reset' | 'submit'
|
||||
disabled?: boolean
|
||||
}) {
|
||||
} & React.ButtonHTMLAttributes<HTMLButtonElement>
|
||||
) {
|
||||
const {
|
||||
children,
|
||||
className,
|
||||
onClick,
|
||||
size = 'md',
|
||||
color = 'indigo',
|
||||
type = 'button',
|
||||
disabled = false,
|
||||
...buttonProps // onClick, disabled, type, etc.
|
||||
} = props
|
||||
|
||||
const sizeClasses = {
|
||||
|
@ -40,7 +34,6 @@ export function Button(props: {
|
|||
|
||||
return (
|
||||
<button
|
||||
type={type}
|
||||
className={clsx(
|
||||
'font-md items-center justify-center rounded-md border border-transparent shadow-sm hover:transition-colors disabled:cursor-not-allowed disabled:opacity-50',
|
||||
sizeClasses,
|
||||
|
@ -56,8 +49,8 @@ export function Button(props: {
|
|||
'border-none bg-white text-gray-500 shadow-none hover:bg-gray-200',
|
||||
className
|
||||
)}
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
type="button"
|
||||
{...buttonProps}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
|
|
Loading…
Reference in New Issue
Block a user