atlp-rwanda/atlp-devpulse-fn

View on GitHub
src/pages/LogoutPage.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { useNavigate } from "react-router-dom";
import { Icon } from "@iconify/react";

const LogoutPage = () => {
  const navigate = useNavigate();
  const handleLogout = async (e: any) => {
    localStorage.clear();
    navigate("/login");
  };
  return (
    <div className="flex ">
      <Icon icon="nimbus:arrow-left"></Icon>
      <button className="ml-2 pt-1" onClick={(e) => handleLogout(e)}>
        Logout
      </button>
    </div>
  );
};
export default LogoutPage;