gitscope
← marzneshin / nightly / dashboard/src/modules/auth/logout/index.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/modules/auth/logout/index.tsx · TypeScript
Blame Raw
 1import { Button } from "@marzneshin/common/components";
 2import { useNavigate } from "@tanstack/react-router";
 3import { LogOut } from "lucide-react";
 4import { FC, useCallback } from "react";
 5
 6interface LogoutProps { }
 7
 8export const Logout: FC<LogoutProps> = () => {
 9    const navigate = useNavigate({ from: "/" });
10    const handleLogout = useCallback(() => {
11        navigate({ to: "/login" });
12    }, [navigate]);
13    return (
14        <Button
15            size="icon"
16            variant="ghost"
17            onClick={handleLogout}
18            className="hstack gap-2 items-center justify-end w-full h-4 p-0"
19        >
20            Logout
21            <LogOut className="size-4" />
22        </Button>
23    );
24};