fix: sync search state on navigation; move pagination before create form in access-lists

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-02-27 18:05:15 +01:00
parent f7a092f1e4
commit f64eb2c8d0
2 changed files with 15 additions and 12 deletions

View File

@@ -122,6 +122,18 @@ export default function AccessListsClient({ lists, pagination }: Props) {
))}
</Stack>
{pageCount > 1 && (
<Box sx={{ display: "flex", justifyContent: "center", mt: 2 }}>
<Pagination
count={pageCount}
page={pagination.page}
onChange={handlePageChange}
color="primary"
shape="rounded"
/>
</Box>
)}
<Stack spacing={2} component="section">
<Typography variant="h6" fontWeight={600}>
Create access list
@@ -148,18 +160,6 @@ export default function AccessListsClient({ lists, pagination }: Props) {
</CardContent>
</Card>
</Stack>
{pageCount > 1 && (
<Box sx={{ display: "flex", justifyContent: "center", mt: 2 }}>
<Pagination
count={pageCount}
page={pagination.page}
onChange={handlePageChange}
color="primary"
shape="rounded"
/>
</Box>
)}
</Stack>
);
}

View File

@@ -24,6 +24,9 @@ export default function AuditLogClient({ events, pagination, initialSearch }: Pr
const pathname = usePathname();
const searchParams = useSearchParams();
const [searchTerm, setSearchTerm] = useState(initialSearch);
useEffect(() => {
setSearchTerm(initialSearch);
}, [initialSearch]);
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const updateSearch = useCallback(