Button.tsx
1 // SPDX-FileCopyrightText: 2024 Mass Labs 2 // 3 // SPDX-License-Identifier: GPL-3.0-or-later 4 5 import React from "react"; 6 7 export interface ButtonProps 8 extends React.ButtonHTMLAttributes<HTMLButtonElement> { 9 custom?: string; 10 } 11 12 const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( 13 ({ ...props }, ref: React.ForwardedRef<HTMLButtonElement>) => { 14 return ( 15 <button 16 className={`flex justify-center cursor-pointer items-center rounded-md 17 ${props.custom ? props.custom : ""}`} 18 style={{ 19 padding: "8px 12px", 20 backgroundColor: props.disabled ? "#e5e7eb" : "#3b513e", 21 color: props.disabled ? "#6a7282" : "white", 22 fontSize: "18px", 23 }} 24 ref={ref} 25 {...props} 26 /> 27 ); 28 }, 29 ); 30 Button.displayName = "Button"; 31 export default Button;