"use client";

import { signOut } from "@/lib/actions/auth";
import { Button } from "@/components/ui/button";
import { useRouter } from "next/navigation";

export function LogoutButton() {
  const router = useRouter();

  const logout = async () => {
    await signOut();
    router.push("/");
    router.refresh();
  };

  return <Button onClick={logout}>Logout</Button>;
}
