File size: 1,078 Bytes
1a9c884
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 { type ReactNode } from "react";
import GlassContainer from "./GlassContainer";
import { GLASS_EFFECTS } from "../constants";

interface GlassButtonProps {
  children: ReactNode;
  onClick: (e: React.MouseEvent) => void;
  className?: string;
  disabled?: boolean;
  bgColor?: string;
  "aria-label"?: string;
}

export default function GlassButton({

  children,

  onClick,

  className = "",

  disabled = false,

  bgColor = GLASS_EFFECTS.COLORS.BUTTON_BG,

  ...ariaProps

}: GlassButtonProps) {
  return (
    <GlassContainer bgColor={bgColor} className="rounded-xl">

      <button

        className={`px-4 py-2 border-none cursor-pointer bg-transparent transition-transform duration-200 outline-none ${

          disabled ? "opacity-50 cursor-not-allowed" : "hover:scale-105 active:scale-95"

        } ${className}`}

        onClick={disabled ? undefined : onClick}

        disabled={disabled}

        {...ariaProps}

      >

        <div className="font-medium text-white">{children}</div>

      </button>

    </GlassContainer>
  );
}