diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx index 23e8b75a..0e3af802 100644 --- a/src/pages/Activities/AttendancePage.jsx +++ b/src/pages/Activities/AttendancePage.jsx @@ -136,6 +136,15 @@ const AttendancePage = () => { : []), ]; // --- END: Tab Configuration Array + useEffect(() => { + if (!orgLoading && organizations?.length === 1) { + setAppliedFilters((prev) => ({ + ...prev, + selectedOrganization: organizations[0].id, + })); + } + }, [orgLoading, organizations]); + return ( <> @@ -173,19 +182,21 @@ const AttendancePage = () => { {/* Tabs header with search and filter */}
- - {/* Tabs Buttons - Now col-12 col-md-6 */} -
+ {/* Tabs Buttons */} +
    {tabsData.map((tab) => (
- {/* Search + Organization Filter - Now col-12 col-md-6 */} -
-
- - {/* Organization */} + {/* Search + Organization filter */} +
+
- - {/* If only 1 organization → show name only */} - {!orgLoading && organizations?.length === 1 && ( -
{organizations[0].name}
- )} - - {/* If multiple organizations → show dropdown */} - {!orgLoading && organizations?.length > 1 && ( - - )} - - {/* Loading case (optional) */} - {orgLoading && ( -
- Loading... -
- )} - +
- - - {/* Search */}
{ onChange={(e) => setSearchTerm(e.target.value)} />
-
-
- {/* Tab Content */}
{selectedProject ? (