import * as React from "react"; import PropTypes from "prop-types"; import { useTheme } from "@mui/material/styles"; import Table from "@mui/material/Table"; import TableBody from "@mui/material/TableBody"; import TableCell from "@mui/material/TableCell"; import TableContainer from "@mui/material/TableContainer"; import TableFooter from "@mui/material/TableFooter"; import TablePagination from "@mui/material/TablePagination"; import TableRow from "@mui/material/TableRow"; import Paper from "@mui/material/Paper"; import IconButton from "@mui/material/IconButton"; import FirstPageIcon from "@mui/icons-material/FirstPage"; import KeyboardArrowLeft from "@mui/icons-material/KeyboardArrowLeft"; import KeyboardArrowRight from "@mui/icons-material/KeyboardArrowRight"; import LastPageIcon from "@mui/icons-material/LastPage"; import { Box, Typography } from "@mui/material"; import Card from "@mui/material/Card"; import Menu from "@mui/material/Menu"; import MenuItem from "@mui/material/MenuItem"; import Tooltip from "@mui/material/Tooltip"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import PrintIcon from "@mui/icons-material/Print"; import DeleteIcon from "@mui/icons-material/Delete"; import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline"; import Checkbox from "@mui/material/Checkbox"; import Link from "next/link"; const label = { inputProps: { "aria-label": "Checkbox demo" } }; function Notification(props) { const theme = useTheme(); 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 ( {theme.direction === "rtl" ? : } {theme.direction === "rtl" ? ( ) : ( )} = Math.ceil(count / rowsPerPage) - 1} aria-label="next page" > {theme.direction === "rtl" ? ( ) : ( )} = Math.ceil(count / rowsPerPage) - 1} aria-label="last page" > {theme.direction === "rtl" ? : } ); } Notification.propTypes = { count: PropTypes.number.isRequired, onPageChange: PropTypes.func.isRequired, page: PropTypes.number.isRequired, rowsPerPage: PropTypes.number.isRequired, }; function createData(id, text, readEmail, date) { return { id, text, readEmail, date }; } const rows = [ createData( "1", "Hello – Trip home from 🎉 Colombo has been arranged, then Jenna will com...", "/email/read-email", "1 Jan 2022" ), createData( "2", "Last pic over my village – Yeah i'd like that! Do you remember the video som..", "/email/read-email", "2 Jan 2022" ), createData( "3", "Mochila Beta: Subscription Confirmed – You've been confirmed! Welcome to ", "/email/read-email", "3 Jan 2022" ), createData( "4", "You've been confirmed! Welcome to the ruling class of the inbox. For your ", "/email/read-email", "4 Jan 2022" ), createData( "5", "For your records, here is a copy of the information you submitted to us...", "/email/read-email", "5 Jan 2022" ), createData( "6", "Hello – Trip home from 🎉 Colombo has been arranged, then Jenna will com...", "/email/read-email", "6 Jan 2022" ), createData( "7", "Hello – Trip home from 🎉 Colombo has been arranged, then Jenna will com...", "/email/read-email", "7 Jan 2022" ), createData( "8", "For your records, here is a copy of the information you submitted to us...", "/email/read-email", "8 Jan 2022" ), createData( "9", "Hello – Trip home from 🎉 Colombo has been arranged, then Jenna will com...", "/email/read-email", "9 Jan 2022" ), createData( "10", "Off on Thursday – Eff that place, you might as well stay here with us inst", "/email/read-email", "10 Jan 2022" ), createData( "11", "Hello – Trip home from 🎉 Colombo has been arranged, then Jenna will com...", "/email/read-email", "11 Jan 2022" ), createData( "12", "This Week's Top Stories – Our top pick for you on Medium this week The", "/email/read-email", "12 Jan 2022" ), createData( "13", "Weekend on Revibe – Today's Friday and we thought maybe you want so", "/email/read-email", "13 Jan 2022" ), createData( "14", "You can now use your storage in Google Drive – Hey Nicklas Sandell! Tha", "/email/read-email", "14 Jan 2022" ), createData( "15", "New Ticket Reply - eDemy - Michel Valenzuela", "/email/read-email", "15 Jan 2022" ), createData( "16", "New Ticket Reply - Abev - Manos Pappas", "/email/read-email", "16 Jan 2022" ), createData( "17", "New Ticket Reply - Lofi - Adarsh Raj", "/email/read-email", "11 Jan 2022" ), ]; export default function NotificationTable() { const [page, setPage] = React.useState(0); const [rowsPerPage, setRowsPerPage] = React.useState(10); // Avoid a layout jump when reaching the last page with empty rows. const emptyRows = page > 0 ? Math.max(0, (1 + page) * rowsPerPage - rows.length) : 0; const handleChangePage = (event, newPage) => { setPage(newPage); }; const handleChangeRowsPerPage = (event) => { setRowsPerPage(parseInt(event.target.value, 10)); setPage(0); }; // Dropdown const [anchorEl, setAnchorEl] = React.useState(null); const open = Boolean(anchorEl); const handleClick = (event) => { setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; return ( <> Notification List Last 15 Days Last Month Last Year {(rowsPerPage > 0 ? rows.slice( page * rowsPerPage, page * rowsPerPage + rowsPerPage ) : rows ).map((row) => ( {row.text} {row.date} ))} {emptyRows > 0 && ( )}
); }