35 lines
941 B
TypeScript
Raw Permalink Normal View History

2024-04-15 23:25:14 -04:00
import { cn } from "@/lib/utils"
2024-10-23 10:51:50 +01:00
import * as React from "react"
2024-04-15 23:25:14 -04:00
2024-04-16 16:25:21 -04:00
const Button = ({
children,
className,
onClick,
type,
2024-04-27 16:22:35 -04:00
disabled = false,
2024-04-16 16:25:21 -04:00
}: {
children: React.ReactNode
className?: string
onClick?: () => void
type?: "button" | "submit" | "reset"
2024-04-27 16:22:35 -04:00
disabled?: boolean
2024-04-16 16:25:21 -04:00
}) => {
2024-04-15 23:25:14 -04:00
return (
2024-04-16 16:25:21 -04:00
<button
onClick={onClick}
2024-04-27 16:22:35 -04:00
disabled={disabled}
type={type ?? "button"}
2024-04-16 16:25:21 -04:00
className={cn(
className,
2024-04-27 16:22:35 -04:00
`gradient-button-bg p-[1px] inline-flex group rounded-md text-sm font-medium focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50`
2024-04-16 16:25:21 -04:00
)}
>
2024-10-23 10:51:50 +01:00
<div className="rounded-[6px] w-full gradient-button transition-colors flex items-center justify-center whitespace-nowrap px-4 py-2 h-9">
2024-04-18 14:42:47 -04:00
{children}
2024-04-15 23:25:14 -04:00
</div>
</button>
)
}
export default Button