Skip to content
Snippets Groups Projects
Commit bc9a9ce0 authored by Léopold Chappuis's avatar Léopold Chappuis
Browse files

admin-accounts-overview: update default row per page options

Change-Id: I98e253db33f84526603a49f605f0a228a9c4aa68
parent 3257f5ec
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,8 @@ function descendingComparator<T>(a: T, b: T, orderBy: keyof T) { ...@@ -51,6 +51,8 @@ function descendingComparator<T>(a: T, b: T, orderBy: keyof T) {
return 0 return 0
} }
const rowPerPagesOptions = [10, 25, 50, 100]
type Order = 'asc' | 'desc' type Order = 'asc' | 'desc'
function getComparator<Key extends keyof any>( function getComparator<Key extends keyof any>(
...@@ -195,7 +197,7 @@ export default function AccountsOverview() { ...@@ -195,7 +197,7 @@ export default function AccountsOverview() {
const [orderBy, setOrderBy] = useState<keyof AccountOverview>('auth') const [orderBy, setOrderBy] = useState<keyof AccountOverview>('auth')
const [selected, setSelected] = useState<readonly string[]>([]) const [selected, setSelected] = useState<readonly string[]>([])
const [page, setPage] = useState(0) const [page, setPage] = useState(0)
const [rowsPerPage, setRowsPerPage] = useState(5) const [rowsPerPage, setRowsPerPage] = useState(rowPerPagesOptions[0])
const getAllAccounts = useGetAllAccounts() const getAllAccounts = useGetAllAccounts()
const accountDeletionMutation = useDeleteAccounts() const accountDeletionMutation = useDeleteAccounts()
...@@ -332,7 +334,7 @@ export default function AccountsOverview() { ...@@ -332,7 +334,7 @@ export default function AccountsOverview() {
</Table> </Table>
</TableContainer> </TableContainer>
<TablePagination <TablePagination
rowsPerPageOptions={[5, 10, 25]} rowsPerPageOptions={rowPerPagesOptions}
component="div" component="div"
count={rows.length} count={rows.length}
rowsPerPage={rowsPerPage} rowsPerPage={rowsPerPage}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment