account and protected router

This commit is contained in:
Виталий Лавшонок
2025-11-05 00:08:51 +03:00
parent 994954c817
commit aeab03d35c
14 changed files with 173 additions and 85 deletions

View File

@@ -0,0 +1,25 @@
import { ReverseButton } from '../../../components/button/ReverseButton';
import { useAppDispatch, useAppSelector } from '../../../redux/hooks';
import { logout } from '../../../redux/slices/auth';
const RightPanel = () => {
const dispatch = useAppDispatch();
const name = useAppSelector((state) => state.auth.username);
const email = useAppSelector((state) => state.auth.email);
return (
<div className="h-full w-full relative p-[20px]">
<div>{name}</div>
<div>{email}</div>
<ReverseButton
className="absolute bottom-[20px] right-[20px]"
onClick={() => {
dispatch(logout());
}}
text="Выход"
color="error"
/>
</div>
);
};
export default RightPanel;