CoolFace
Apppublic

jjwiseman/fastvlm-webgpu

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
GlassButton.tsx37 linesDownload Raw Back to components
1import { type ReactNode } from "react";2import GlassContainer from "./GlassContainer";3import { GLASS_EFFECTS } from "../constants";4 5interface GlassButtonProps {6  children: ReactNode;7  onClick: (e: React.MouseEvent) => void;8  className?: string;9  disabled?: boolean;10  bgColor?: string;11  "aria-label"?: string;12}13 14export default function GlassButton({15  children,16  onClick,17  className = "",18  disabled = false,19  bgColor = GLASS_EFFECTS.COLORS.BUTTON_BG,20  ...ariaProps21}: GlassButtonProps) {22  return (23    <GlassContainer bgColor={bgColor} className="rounded-xl">24      <button25        className={`px-4 py-2 border-none cursor-pointer bg-transparent transition-transform duration-200 outline-none ${26          disabled ? "opacity-50 cursor-not-allowed" : "hover:scale-105 active:scale-95"27        } ${className}`}28        onClick={disabled ? undefined : onClick}29        disabled={disabled}30        {...ariaProps}31      >32        <div className="font-medium text-white">{children}</div>33      </button>34    </GlassContainer>35  );36}37