18 lines
364 B
TypeScript
18 lines
364 B
TypeScript
"use client";
|
|
|
|
export function LogoutButton() {
|
|
const handleLogout = async () => {
|
|
await fetch("/api/admin/logout", { method: "POST" });
|
|
window.location.href = "/admin/login";
|
|
};
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={handleLogout}
|
|
className="text-sm text-gray-500 hover:text-gray-700"
|
|
>
|
|
Logout
|
|
</button>
|
|
);
|
|
}
|