forked from asyncapi/conference-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.tsx
More file actions
37 lines (33 loc) · 768 Bytes
/
Copy pathbutton.tsx
File metadata and controls
37 lines (33 loc) · 768 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
import React from 'react';
type ButtonType = 'button' | 'submit' | 'reset' | undefined;
interface IButton {
className?: string;
children: React.ReactNode;
overlay?: boolean;
onClick?: React.MouseEventHandler;
type: ButtonType;
disabled?: boolean;
test?: string;
}
function Button({
className,
children,
overlay,
onClick,
type,
disabled,
test,
}: IButton): React.JSX.Element {
return (
<button
disabled={disabled}
data-test={test || ''}
type={type}
onClick={onClick}
className={`${overlay ? '' : 'gradient-bg'} ${disabled && 'cursor-not-allowed'} flex items-center justify-center text-white h-[54px] rounded-md p-[8px] ${className}`}
>
{children}
</button>
);
}
export default Button;