Refactor comments

This commit is contained in:
nabenabe0928
2024-01-15 12:47:45 +01:00
parent 4e48165a2e
commit c792a8bf13
+3 -2
View File
@@ -49,7 +49,7 @@ function PaginationTextFieldComponent(props: {
onInputChange: (value: number) => void
maxPageNumber: number
}): React.ReactElement {
// This component is separated from DataGrid to prevent it from updating,
// This component is separated from DataGrid to prevent `DataGrid` from re-rendering the page,
// every time any letters are input.
const { onInputChange, maxPageNumber } = props
const [navigationPage, setNavigationPage] = React.useState("")
@@ -62,7 +62,7 @@ function PaginationTextFieldComponent(props: {
return
}
const newPageNumber = newPage <= 0 ? 1 : Math.min(newPage, maxPageNumber)
// 0-indexed.
// Page is 0-indexed in `TablePagination`.
onInputChange(newPageNumber - 1)
}
@@ -215,6 +215,7 @@ function DataGrid<T>(props: {
</Table>
</TableContainer>
{filteredRows.length > 0 ? (
// tslint:disable-next-line: 2590
<Box display="flex" alignItems="center">
<TablePagination
rowsPerPageOptions={rowsPerPageOption}