LogOutButton component

This commit is contained in:
Oliver Bryan
2025-12-22 06:33:15 +00:00
parent 200fbc28e3
commit aa0171b4f3

View File

@@ -0,0 +1,17 @@
import { LogOut } from "lucide-react";
import { Button } from "@/components/ui/button";
export default function LogOutButton() {
const logOut = () => {
localStorage.removeItem("token");
localStorage.removeItem("user");
window.location.href = "/";
};
return (
<Button onClick={logOut} variant={"destructive"} className="flex gap-2 items-center">
Log out
<LogOut size={15} />
</Button>
);
}