diff --git a/Client/src/Components/BasicTable/index.css b/Client/src/Components/BasicTable/index.css index 629c8dd7b..821726cf4 100644 --- a/Client/src/Components/BasicTable/index.css +++ b/Client/src/Components/BasicTable/index.css @@ -10,7 +10,6 @@ } .MuiTable-root .host div:nth-child(2) { width: fit-content; - font-weight: 500; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; @@ -125,3 +124,64 @@ .MuiPaper-root + .MuiPagination-root div.MuiPaginationItem-root { user-select: none; } + +.MuiTablePagination-root p { + color: var(--env-var-color-2); + font-weight: 500; +} +.MuiTablePagination-root button, +.MuiTablePagination-root .MuiSelect-select { + border: solid 1px #ebebeb; + border-radius: var(--env-var-radius-1); +} +.MuiTablePagination-root .MuiTablePagination-select.MuiSelect-select { + text-align: left; + text-align-last: left; +} +.MuiTablePagination-root button { + min-width: 0; + padding: 4px; + margin-left: 5px; +} +.MuiTablePagination-root svg { + width: 22px; + height: 22px; +} +.MuiTablePagination-root svg path { + stroke: var(--env-var-color-5); + stroke-width: 1.3; +} +.MuiTablePagination-root .MuiSelect-icon { + width: 16px; + height: 16px; + top: 50%; + right: 8%; + transform: translateY(-50%); +} +.MuiTablePagination-root button.Mui-disabled { + opacity: 0.4; +} +.MuiTablePagination-root button:not(.Mui-disabled):hover { + background-color: #f4f4f4; + border-color: #f4f4f4; +} + +.pagination-dropdown.MuiPaper-root { + box-shadow: var(--env-var-shadow-1); + border: solid 1px var(--env-var-color-6); + border-radius: var(--env-var-radius-1); +} +.pagination-dropdown ul { + padding: 4px; + min-width: 100px; +} +.pagination-dropdown li { + font-size: var(--env-var-font-size-medium); + color: var(--env-var-color-2); + padding: 4px; +} +.pagination-dropdown li.Mui-selected, +.pagination-dropdown li.Mui-selected.Mui-focusVisible, +.pagination-dropdown li.Mui-selected:hover { + background-color: #f4f4f4; +} diff --git a/Client/src/Components/BasicTable/index.jsx b/Client/src/Components/BasicTable/index.jsx index 76f1c61c7..b9bbb795e 100644 --- a/Client/src/Components/BasicTable/index.jsx +++ b/Client/src/Components/BasicTable/index.jsx @@ -1,3 +1,6 @@ +import PropTypes from "prop-types"; +import { useState, useEffect } from "react"; +import { useTheme } from "@emotion/react"; import { TableContainer, Paper, @@ -6,14 +9,83 @@ import { TableRow, TableCell, TableBody, - Pagination, - PaginationItem, + TablePagination, + Box, + Typography, + Stack, } from "@mui/material"; -import React, { useState, useEffect } from "react"; -import PropTypes from "prop-types"; +import LeftArrowDouble from "../../assets/icons/left-arrow-double.svg?react"; +import RightArrowDouble from "../../assets/icons/right-arrow-double.svg?react"; +import LeftArrow from "../../assets/icons/left-arrow.svg?react"; +import RightArrow from "../../assets/icons/right-arrow.svg?react"; +import SelectorVertical from "../../assets/icons/selector-vertical.svg?react"; +import Button from "../Button"; import "./index.css"; -import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded"; -import ArrowForwardRoundedIcon from "@mui/icons-material/ArrowForwardRounded"; +/** + * Component for pagination actions (first, previous, next, last). + * + * @component + * @param {Object} props + * @param {number} props.count - Total number of items. + * @param {number} props.page - Current page number. + * @param {number} props.rowsPerPage - Number of rows per page. + * @param {function} props.onPageChange - Callback function to handle page change. + * + * @returns {JSX.Element} Pagination actions component. + */ +const TablePaginationActions = (props) => { + const { count, page, rowsPerPage, onPageChange } = props; + + const handleFirstPageButtonClick = (event) => { + onPageChange(event, 0); + }; + const handleBackButtonClick = (event) => { + onPageChange(event, page - 1); + }; + const handleNextButtonClick = (event) => { + onPageChange(event, page + 1); + }; + const handleLastPageButtonClick = (event) => { + onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1)); + }; + + return ( + +