diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx
index 5b07002e..0c8791f5 100644
--- a/src/pages/Activities/AttendancePage.jsx
+++ b/src/pages/Activities/AttendancePage.jsx
@@ -59,7 +59,7 @@ const AttendancePage = () => {
if (selectedProject == null) {
dispatch(setProjectId(projectNames[0]?.id));
}
- dispatch(setOrganization(appliedFilters?.selectedOrganization))
+ dispatch(setOrganization(appliedFilters?.selectedOrganization));
}, [appliedFilters?.selectedOrganization]);
const getRole = (roleId) => {
@@ -94,6 +94,49 @@ const AttendancePage = () => {
setSearchTerm(""); // Reset search term when tab changes
};
+ // --- START: Tab Configuration Array
+ const tabsData = [
+ {
+ id: "all",
+ title: "Today's",
+ content: (
+
+ ),
+ },
+ {
+ id: "logs",
+ title: "Logs",
+ content: (
+
+ ),
+ },
+ // Conditionally include Regularization tab based on permission
+ ...(DoRegularized
+ ? [
+ {
+ id: "regularization",
+ title: "Regularization",
+ content: (
+
+ ),
+ },
+ ]
+ : []),
+ ];
+ // --- END: Tab Configuration Array
+
return (
<>
{isCreateModalOpen && modelConfig && (
@@ -114,9 +157,7 @@ const AttendancePage = () => {
{modelConfig?.action === 6 && (
)}
- {modelConfig?.action === 7 && (
-
- )}
+ {modelConfig?.action === 7 && }
)}
@@ -129,57 +170,39 @@ const AttendancePage = () => {
>
- {/* Tabs */}
-
+ {/* Tabs header with search and filter */}
+
- {/* Tabs */}
-
+ {/* Tabs Buttons */}
+
- -
-
-
- -
-
-
-
- -
-
-
+
+
+ ))}
{/* Search + Organization filter */}
-
+ {/* Tab Content */}
{selectedProject ? (
<>
- {activeTab === "all" && (
-
-
+ {tabsData.map((tab) => (
+
+ {activeTab === tab.id && tab.content}
- )}
- {activeTab === "logs" && (
-
- )}
- {activeTab === "regularization" && DoRegularized && (
-
-
-
- )}
+ ))}
>
) : (
@@ -259,4 +267,4 @@ const AttendancePage = () => {
);
};
-export default AttendancePage;
+export default AttendancePage;
\ No newline at end of file