Skip to content

Commit 1a23e52

Browse files
authored
Add pagination to ApplicationOrganizer component (#1362) (#1363)
- Introduced currentPage state to manage pagination. - Updated application state change handler to reset currentPage on filter change. - Configured pagination settings for the data table.
1 parent 4b5d0bc commit 1a23e52

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frontend/src/components/pages/ApplicationOrganizer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function ApplicationOrganizer({ isMentor }) {
2525
const [selectedID, setSelectedID] = useState(null);
2626
const [appInfo, setAppInfo] = useState({});
2727
const [loading, setLoading] = useState(true);
28+
const [currentPage, setCurrentPage] = useState(1);
2829

2930
const handleApplicationStateChange = useCallback(
3031
async (id, newState) => {
@@ -275,6 +276,7 @@ function ApplicationOrganizer({ isMentor }) {
275276
onChange={(value) => {
276277
setAppstate(value);
277278
setFilterdData(filterApplications(applicationData, value));
279+
setCurrentPage(1);
278280
}}
279281
placeholder="Role"
280282
value={appState}
@@ -297,6 +299,10 @@ function ApplicationOrganizer({ isMentor }) {
297299
id="applicationstable"
298300
columns={columns}
299301
dataSource={filterdData}
302+
pagination={{
303+
current: currentPage,
304+
onChange: (page) => setCurrentPage(page),
305+
}}
300306
/>
301307
)}
302308
</div>

0 commit comments

Comments
 (0)