// AdminScopeToggle.js // Two-state toggle for Admin users: "My Teams" vs "All BUs" // Controls whether data on Reporting, Compliance, and Exports pages // is scoped to the admin's assigned teams or shows everything. import React from 'react'; import { useAuth } from '../contexts/AuthContext'; function AdminScopeToggle() { const { isAdmin, adminScope, toggleAdminScope, hasTeams } = useAuth(); // Only render for Admin users who have teams assigned // (if no teams assigned, both modes are identical — no toggle needed) if (!isAdmin() || !hasTeams()) return null; const isAllMode = adminScope === 'all'; return (
Scope:
); } export default AdminScopeToggle;