import React from "react"; import { useSelector, useDispatch } from "react-redux"; import { toggle } from "../../Features/Login/LoginSlice"; import { Button } from "@mui/material"; import styles from "../../styles"; import { useNavigate } from "react-router-dom"; export interface state { logged_in: { value: boolean; }; } export interface props { children: React.ReactNode; } export default function Logout(props: props) { const logged_in = useSelector((state: state) => state.logged_in.value); const dispatch = useDispatch(); const navigate = useNavigate(); async function logout() { await dispatch(toggle()); navigate("/"); } return (
); }