import {NextLinkComposed} from "@/core/components/LinkRouting"; import Message from "@/core/components/Messages"; import useUser from "@/lib/app/hooks/useUser"; import {Button, Typography} from "@mui/material"; import {useTranslations} from "next-intl"; const UserTypeMiddleware = ({children, user_type}) => { const {user} = useUser(); const t = useTranslations(); const userPermission = user.type_id === user_type; if (!userPermission) { return ( {t("Permission.typography_you_dont_have_access")} } actions={ <> } /> ); } return <>{children}; }; export default UserTypeMiddleware;