File size: 481 Bytes
79278ec
 
 
 
 
 
 
 
 
 
 
 
 
 
19eca0c
79278ec
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Spinner from "../spinner/Spinner";
import { ButtonProps } from "./Button.interface";
import "./Button.scss";

const Button = ({
  name = "",
  onClick,
  buttonType = "primary",
  disabled,
  loading = false,
  icon = null,
  className,
}: ButtonProps) => {
  return (
    <button onClick={onClick} className={`btn ${buttonType} ${className ?? ''}`} disabled={disabled}>
      {name}
      {icon}
      {loading && <Spinner />}
    </button>
  );
};

export default Button;