-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButton.tsx
38 lines (34 loc) · 990 Bytes
/
Button.tsx
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
import { cn } from "@/utils/helper";
import React, { ReactNode } from "react";
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
size?: "small" | "large";
className?: string;
children?: ReactNode;
outline?: boolean;
}
const Button: React.FC<ButtonProps> = ({
children,
className,
size = "small",
outline = false,
...props
}) => {
return (
<button
className={cn(
`disabled:opacity-70 disabled:cursor-not-allowed rounded hover:opacity-80 transition w-full bg-rose-500 border-rose-500 text-white py-[8px] `,
size === "small"
? " text-[16px] font-medium border-[1px]"
: " text-[18px] font-semibold border-2",
outline
? "bg-white border-[1px] border-gray-500 text-[#4e4e4e]"
: "bg-rose-500 border-rose-500 text-white",
className
)}
{...props}
>
{children}
</button>
);
};
export default Button;