Skip to content

Commit

Permalink
fmt: add missed files
Browse files Browse the repository at this point in the history
  • Loading branch information
parz3val committed Jan 2, 2025
1 parent 2b7029f commit 463f3d9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
45 changes: 26 additions & 19 deletions mods/webui/src/stories/pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,36 @@ export const Pagination = (props: PaginationProps) => {

const handleChangePage = (
event: React.MouseEvent<HTMLButtonElement> | null,
newPage: number,
newPage: number
) => {
onClick(event, newPage)
onClick(event, newPage);
setPage(newPage);
};

const renderDisplayedRows = ({ from, to, count }: { from: number; to: number; count: number }) => (
<Typography variant="body-medium" >
{`${from}-${to} of ${count}`}
</Typography>
const renderDisplayedRows = ({
from,
to,
count
}: {
from: number;
to: number;
count: number;
}) => (
<Typography variant="body-medium">{`${from}-${to} of ${count}`}</Typography>
);


return <StyledPagination
count={count}
disabled={disabled}
component="div"
onPageChange={handleChangePage}
page={page}
rowsPerPage={rowsPerPage ? rowsPerPage : 10}
rowsPerPageOptions={[]}
labelRowsPerPage=''
labelDisplayedRows={renderDisplayedRows}
className={disabled ? "disabled" : ""}
/>;
return (
<StyledPagination
count={count}
disabled={disabled}
component="div"
onPageChange={handleChangePage}
page={page}
rowsPerPage={rowsPerPage ? rowsPerPage : 10}
rowsPerPageOptions={[]}
labelRowsPerPage=""
labelDisplayedRows={renderDisplayedRows}
className={disabled ? "disabled" : ""}
/>
);
};
9 changes: 6 additions & 3 deletions mods/webui/src/stories/pagination/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
* limitations under the License.
*/
type PaginationProps = {
onClick?: (event: React.MouseEvent<HTMLButtonElement> | null, newPage: number) => void;
onClick?: (
event: React.MouseEvent<HTMLButtonElement> | null,
newPage: number
) => void;
count: number;
disabled: boolean,
rowsPerPage?: number,
disabled: boolean;
rowsPerPage?: number;
};

export type { PaginationProps };

0 comments on commit 463f3d9

Please sign in to comment.