32 lines
797 B
32 lines
797 B
import React from "react"; |
|
const Button = ({ |
|
className, |
|
iconClassName, |
|
iconHolderClassName, |
|
icon, |
|
text, |
|
onClick, |
|
}) => { |
|
return ( |
|
<button |
|
onClick={onClick} |
|
className={`flex items-center justify-center transiton ease-linear duration-200 hover:bg-opacity-70 ${className}`} |
|
> |
|
{text} |
|
{icon && ( |
|
<span className={`${iconHolderClassName}`}> |
|
<img src={icon} alt="icon" className={`${iconClassName}`} /> |
|
</span> |
|
)} |
|
</button> |
|
); |
|
}; |
|
|
|
export default Button; |
|
Button.defaultProps = { |
|
className: |
|
"bg-red-400 text-white hover:bg-gray-900 border border-b-4 border-lightBlueBorderColor rounded text-sm px-4 py-4", |
|
iconHolderClassName: "bg-darkGreenBg mr-2", |
|
iconClassName: "w-4", |
|
text: "اطلاعات بیشتر", |
|
};
|
|
|