Heb er een PWA van gemaakt en layout gecorrigeerd
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { t, type Locale } from "@/lib/i18n";
|
||||
|
||||
export default function LogoutButton({ locale }: { locale: Locale }) {
|
||||
const router = useRouter();
|
||||
|
||||
async function handleLogout() {
|
||||
await fetch("/api/auth/logout", { method: "POST" });
|
||||
router.push("/login");
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleLogout}
|
||||
className="inline-flex h-10 items-center rounded-lg bg-white/10 px-4 text-sm font-semibold text-white ring-1 ring-white/30 transition hover:bg-white/20"
|
||||
>
|
||||
{t(locale, "auth.logout")}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user