/ src / components / Button / Button.tsx
Button.tsx
 1  import React from "react";
 2  
 3  interface ButtonProps {
 4    href?: string;
 5    text: string;
 6    className?: string;
 7    onClick?: () => void;
 8    styles?: React.CSSProperties
 9  }
10  
11  const Button: React.FC<ButtonProps> = ({ href, text, className, onClick, styles }) => {
12    if (href) {
13      return (
14        <a href={href} className={`button-class ${className}`} style={styles}>
15          {text}
16        </a>
17      );
18    }
19  
20    return (
21      <button
22        onClick={onClick}
23        className={`button-class ${className}`}
24        style={styles}
25      >
26        {text}
27      </button>
28    );
29  };
30  
31  export default Button;