2023-06-15 12:52:46 +03:00
|
|
|
/* eslint-disable */
|
2023-05-26 11:57:29 +03:00
|
|
|
"use client";
|
2023-06-15 12:52:46 +03:00
|
|
|
import Link from "next/link";
|
|
|
|
|
2023-06-13 17:33:41 +03:00
|
|
|
import Button from "@/lib/components/ui/Button";
|
|
|
|
import Card from "@/lib/components/ui/Card";
|
|
|
|
import PageHeading from "@/lib/components/ui/PageHeading";
|
2023-06-30 14:17:38 +03:00
|
|
|
import { useLogout } from "./hooks/useLogout";
|
2023-05-26 11:57:29 +03:00
|
|
|
|
|
|
|
export default function Logout() {
|
2023-06-30 14:17:38 +03:00
|
|
|
const { handleLogout, isPending } = useLogout();
|
2023-05-26 11:57:29 +03:00
|
|
|
return (
|
2023-07-03 15:59:24 +03:00
|
|
|
<main data-testid="logout-page">
|
2023-06-11 11:44:23 +03:00
|
|
|
<section className="w-full min-h-[80vh] h-full outline-none flex flex-col gap-5 items-center justify-center p-6">
|
2023-05-26 11:57:29 +03:00
|
|
|
<PageHeading title="Logout" subtitle="See you next time" />
|
|
|
|
<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">Are you sure you want to sign out?</h2>
|
|
|
|
<div className="flex gap-5 items-center justify-center">
|
|
|
|
<Link href={"/"}>
|
|
|
|
<Button variant={"primary"}>Go back</Button>
|
|
|
|
</Link>
|
|
|
|
<Button
|
|
|
|
isLoading={isPending}
|
|
|
|
variant={"danger"}
|
|
|
|
onClick={() => handleLogout()}
|
2023-07-03 15:59:24 +03:00
|
|
|
data-testid="logout-button"
|
2023-05-26 11:57:29 +03:00
|
|
|
>
|
|
|
|
Log Out
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</Card>
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
);
|
|
|
|
}
|