From b6447d4d21e7e682ef320495862b7eb729fb5e77 Mon Sep 17 00:00:00 2001 From: 2ManyProjects Date: Sat, 26 Apr 2025 11:22:40 -0500 Subject: [PATCH] minor --- frontend/src/pages/Admin/CustomersPage.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Admin/CustomersPage.jsx b/frontend/src/pages/Admin/CustomersPage.jsx index 8c6caf5..40d00cd 100644 --- a/frontend/src/pages/Admin/CustomersPage.jsx +++ b/frontend/src/pages/Admin/CustomersPage.jsx @@ -37,8 +37,9 @@ import { import { useAdminUsers, useUpdateUser } from '@hooks/adminHooks'; import { format } from 'date-fns'; import EmailDialog from '@components/EmailDialog'; - +import { useAuth } from '@hooks/reduxHooks'; const AdminCustomersPage = () => { + const { user, isAuthenticated } = useAuth(); const [page, setPage] = useState(0); const [rowsPerPage, setRowsPerPage] = useState(10); const [search, setSearch] = useState(''); @@ -328,24 +329,25 @@ const AdminCustomersPage = () => { } - label={formData.is_disabled ? "Account is disabled" : "Account is active"} + label={`${formData.is_disabled ? "Account is disabled" : "Account is active"}` + `${user === currentUser.id && formData.is_admin? " (Current user can\'t disabled themselves)" : "" }`} sx={{ my: 2, display: 'block' }} /> - } - label={formData.is_admin ? "Account is Admin" : "Account is not Admin"} + label={`${formData.is_admin ? "Account is Admin" : "Account is not Admin"}` + `${user === currentUser.id && formData.is_admin? " (Admin can't downgrade themselves)" : "" }`} sx={{ my: 2, display: 'block' }} />