15 lines
401 B
TypeScript
15 lines
401 B
TypeScript
import { FC } from "react";
|
|
import { Navigate } from "@tanstack/react-router";
|
|
import { useSelector } from "react-redux";
|
|
import { RootState } from "../../redux/store.ts";
|
|
|
|
const MainPage: FC = () => {
|
|
const authState = useSelector((state: RootState) => state.auth);
|
|
if (authState.isAuthorized) {
|
|
return <Navigate to={"/leads"} />;
|
|
}
|
|
return <></>;
|
|
};
|
|
|
|
export default MainPage;
|