mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-24 20:03:41 +03:00
b0514d6149
* add libraries for traslation purposes * Add button and service for language selection * add spanish translation on login page * add spanish translation on upload page * Add spanish translations for explore page * Add translations on user page * Add translations for config page * Add spanish translations on chat page * add translations for brain page * fix GUI and save on local storage * fix (i18n) init and types * fix (i18n): typos * add translation on new brain modal * add translations on metadata * Add translations on home page * fixes types * fix(frontend-tests): use get by id instead of text --------- Co-authored-by: Gustavo Maciel <gustavo_m13@outlook.com>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
/* eslint-disable */
|
|
"use client";
|
|
import Link from "next/link";
|
|
|
|
import Button from "@/lib/components/ui/Button";
|
|
import Card from "@/lib/components/ui/Card";
|
|
import PageHeading from "@/lib/components/ui/PageHeading";
|
|
import { useLogout } from "./hooks/useLogout";
|
|
import { useTranslation } from "react-i18next";
|
|
import { Suspense } from "react";
|
|
|
|
export default function Logout() {
|
|
|
|
const {t, i18n} = useTranslation(["translation","logout"]);
|
|
|
|
const { handleLogout, isPending } = useLogout();
|
|
|
|
function Logout() {
|
|
return (
|
|
<main data-testid="logout-page">
|
|
<section className="w-full min-h-[80vh] h-full outline-none flex flex-col gap-5 items-center justify-center p-6">
|
|
<PageHeading title={t("title",{ ns: "logout" })} subtitle={t("subtitle",{ ns: "logout" })} />
|
|
<Card className="max-w-md w-full p-5 sm:p-10 text-center flex flex-col items-center gap-5">
|
|
<h2 className="text-lg">{t("areYouSure",{ ns: "logout" })}</h2>
|
|
<div className="flex gap-5 items-center justify-center">
|
|
<Link href={"/"}>
|
|
<Button variant={"primary"}>{t("cancel",{ ns: "logout" })}</Button>
|
|
</Link>
|
|
<Button
|
|
isLoading={isPending}
|
|
variant={"danger"}
|
|
onClick={() => handleLogout()}
|
|
data-testid="logout-button"
|
|
>
|
|
{t("logoutButton")}
|
|
</Button>
|
|
</div>
|
|
</Card>
|
|
</section>
|
|
</main>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Suspense fallback={"Loading..."}>
|
|
<Logout />
|
|
</Suspense>
|
|
)
|
|
|
|
}
|