Abdullahrasheed45 commited on
Commit
7770ae5
·
verified ·
1 Parent(s): d7cbbd6

Create Button.tsx

Browse files
Files changed (1) hide show
  1. src/components/Button.tsx +32 -0
src/components/Button.tsx ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { type ReactNode } from "react";
2
+ import { THEME } from "../constants";
3
+
4
+ interface ButtonProps {
5
+ children: ReactNode;
6
+ onClick: (e: React.MouseEvent) => void;
7
+ className?: string;
8
+ disabled?: boolean;
9
+ "aria-label"?: string;
10
+ }
11
+
12
+ export default function Button({
13
+ children,
14
+ onClick,
15
+ className = "",
16
+ disabled = false,
17
+ ...ariaProps
18
+ }: ButtonProps) {
19
+ return (
20
+ <button
21
+ className={`px-4 py-2 rounded-xl border-none cursor-pointer outline-none ${
22
+ disabled ? "opacity-50 cursor-not-allowed" : ""
23
+ } ${className}`}
24
+ style={{ backgroundColor: THEME.mistralOrange }}
25
+ onClick={disabled ? undefined : onClick}
26
+ disabled={disabled}
27
+ {...ariaProps}
28
+ >
29
+ <div className="font-medium text-white">{children}</div>
30
+ </button>
31
+ );
32
+ }