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:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user