import { View } from "@tarojs/components";

interface IProps {
  onClick: ()=> {}
  disabled?: boolean
  children: JSX.Element|JSX.Element[]|string
}
export default function ButtonMain({ onClick, disabled = false, children }:IProps) {
  const handleClick = ()=> {
    if(!disabled){
      onClick()
    }
  }
  return (
    <View className={`button-rounded button-primary flex-1 ${disabled ? 'opacity-50': ''}`} onClick={handleClick}>{children}</View>
  );
}
