import { IonButton, IonContent, IonIcon, IonItem, IonText } from "@ionic/react";
import { CallNumber } from "@awesome-cordova-plugins/call-number";
import {
 call,
 mailOpen
  } from "ionicons/icons";

const ButtonComponent: React.FC<{
  body: string;
}> = (props) => {
  const body = props.body;
  return (
    <IonText>
      <IonButton expand="block" 
        onClick={() => {
          CallNumber.callNumber("7876247846", true);
          alert("testing is this works");
        }}
      >
         <IonIcon slot="start" icon={call}> </IonIcon>
        Llamada
      </IonButton>
      <a href={"mailto:eliamruiz2027@gmail.com?cc=eliam.ruiz@upr.edu,&subject=Testing Ionic button&body=" + body + ""}>
        <IonButton expand="block">
        <IonIcon slot="start" icon={mailOpen}> </IonIcon> Correo Electrónico</IonButton>
      </a>
    </IonText>
  );
};
export default ButtonComponent;
