"use client"; import { useState } from "react"; import { signOut } from "next-auth/react"; import { LogOut } from "lucide-react"; import { Button } from "@/components/ui/button"; /** * Ends the Auth.js session and returns to the login page. Lives in the app * header so it is reachable from every authenticated screen, on mobile and * desktop alike. */ export function SignOutButton() { const [busy, setBusy] = useState(false); async function onSignOut() { setBusy(true); try { await signOut({ callbackUrl: "/login" }); } finally { setBusy(false); } } return ( ); }