import { Navigate } from 'react-router-dom'; import { useAuthStore } from '../../store/authStore'; interface AwsAdminGuardProps { children: React.ReactNode; } /** * Route guard that only allows access to users of the aws-admin account * Used for the single remaining admin dashboard page */ export const AwsAdminGuard: React.FC = ({ children }) => { const { user, loading } = useAuthStore(); if (loading) { return (
); } // Check if user belongs to aws-admin account const isAwsAdmin = user?.account?.slug === 'aws-admin'; if (!isAwsAdmin) { return ; } return <>{children}; };