// src/components/LogoutButton.tsx
import { IonButton, IonIcon } from "@ionic/react";
import { logOutOutline } from "ionicons/icons";
import { logout } from "../services/auth";

type Props = { label?: string };

export default function LogoutButton({ label = "Cerrar sesión" }: Props) {
  return (
    <IonButton color="medium" onClick={() => logout()}>
      <IonIcon slot="start" icon={logOutOutline} />
      {label}
    </IonButton>
  );
}
