"use client";

export function LogoutButton({ className = "" }: { className?: string }) {
  async function onClick() {
    await fetch("/api/auth/logout", { method: "POST" });
    window.location.href = "/";
  }
  return (
    <button type="button" onClick={onClick} className={className}>
      Sign out
    </button>
  );
}
