import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import classNames from 'classnames'; import Cookies from 'universal-cookie'; import { Button } from 'primereact/button'; import { Menubar } from 'primereact/menubar'; const cookies = new Cookies(); export const AppTopbar = (props) => { const [logged, setLogged] = useState(null); function cerrarSesion() { cookies.remove('id', { path: "/" }); cookies.remove('email', { path: "/" }); cookies.remove('name', { path: "/" }); cookies.remove('type', { path: "/" }); cookies.remove('community_id', { path: "/" }); window.location.href = '/login'; } useEffect(() => { if (cookies.get('email')) { setLogged(true); } else { setLogged(false); }; }, []) const buttonLogout = () => { return ( <>