import { Navigate } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
const RoleProtectedRoute = ({ children, allowedRoles }) => {
const { user } = useAuth();
if (!user) return ;
if (!allowedRoles.includes(user.role)) return ;
return children;
};
export default RoleProtectedRoute;