Improved the overall stability and speed of the app

This commit is contained in:
Tiago Ribeiro
2024-08-29 23:21:20 +01:00
parent b57e11bec4
commit 39710aaea1
17 changed files with 315 additions and 280 deletions

View File

@@ -22,6 +22,7 @@ import WritingGeneration from "./(generation)/WritingGeneration";
import LevelGeneration from "./(generation)/LevelGeneration";
import SpeakingGeneration from "./(generation)/SpeakingGeneration";
import {checkAccess} from "@/utils/permissions";
import {User} from "@/interfaces/user";
export const getServerSideProps = withIronSessionSsr(({req, res}) => {
const user = req.session.user;
@@ -49,10 +50,12 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
};
}, sessionOptions);
export default function Generation() {
const [module, setModule] = useState<Module>("reading");
interface Props {
user: User;
}
const {user} = useUser({redirectTo: "/login"});
export default function Generation({user}: Props) {
const [module, setModule] = useState<Module>("reading");
const [title, setTitle] = useState<string>("");
return (