Enhance Next.js configuration and dependencies for improved functionality and localization support. Added support for internationalization with next-intl, updated global styles, and integrated new fonts. Removed default home page and updated README with project details and setup instructions.
This commit is contained in:
1 parent
2911dea00b
commit
44f4fa98e2
320 files changed
+31666
-220
No files matched your search
@@ -0,0 +1,28 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
export function LogoutButton() {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function handleLogout() {
|
||||
setLoading(true);
|
||||
try {
|
||||
await fetch("/api/admin/logout", { method: "POST" });
|
||||
} catch {
|
||||
// ignore network errors — still navigate to login
|
||||
} finally {
|
||||
router.push("/admin/login");
|
||||
router.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Button variant="ghost" size="sm" onClick={handleLogout} disabled={loading}>
|
||||
{loading ? "…" : "خروج"}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user