first commit
This commit is contained in:
@@ -0,0 +1,575 @@
|
||||
import * as React from "react";
|
||||
import { Box, Typography } from "@mui/material";
|
||||
import Card from "@mui/material/Card";
|
||||
import PropTypes from "prop-types";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import Table from "@mui/material/Table";
|
||||
import TableHead from "@mui/material/TableHead";
|
||||
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 Tooltip from "@mui/material/Tooltip";
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import DriveFileRenameOutlineIcon from "@mui/icons-material/DriveFileRenameOutline";
|
||||
import Checkbox from "@mui/material/Checkbox";
|
||||
|
||||
const label = { inputProps: { "aria-label": "Checkbox demo" } };
|
||||
|
||||
function CustomersDetail(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 (
|
||||
<Box sx={{ flexShrink: 0, ml: 2.5 }}>
|
||||
<IconButton
|
||||
onClick={handleFirstPageButtonClick}
|
||||
disabled={page === 0}
|
||||
aria-label="first page"
|
||||
>
|
||||
{theme.direction === "rtl" ? <LastPageIcon /> : <FirstPageIcon />}
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={handleBackButtonClick}
|
||||
disabled={page === 0}
|
||||
aria-label="previous page"
|
||||
>
|
||||
{theme.direction === "rtl" ? (
|
||||
<KeyboardArrowRight />
|
||||
) : (
|
||||
<KeyboardArrowLeft />
|
||||
)}
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={handleNextButtonClick}
|
||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||
aria-label="next page"
|
||||
>
|
||||
{theme.direction === "rtl" ? (
|
||||
<KeyboardArrowLeft />
|
||||
) : (
|
||||
<KeyboardArrowRight />
|
||||
)}
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={handleLastPageButtonClick}
|
||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||
aria-label="last page"
|
||||
>
|
||||
{theme.direction === "rtl" ? <FirstPageIcon /> : <LastPageIcon />}
|
||||
</IconButton>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
CustomersDetail.propTypes = {
|
||||
count: PropTypes.number.isRequired,
|
||||
onPageChange: PropTypes.func.isRequired,
|
||||
page: PropTypes.number.isRequired,
|
||||
rowsPerPage: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
function createData(
|
||||
name,
|
||||
userName,
|
||||
image,
|
||||
email,
|
||||
rolls,
|
||||
status,
|
||||
badgeClass,
|
||||
projects
|
||||
) {
|
||||
return {
|
||||
name,
|
||||
userName,
|
||||
image,
|
||||
email,
|
||||
rolls,
|
||||
status,
|
||||
badgeClass,
|
||||
projects,
|
||||
};
|
||||
}
|
||||
|
||||
const rows = [
|
||||
createData(
|
||||
"Evangelina Mcclain",
|
||||
"@jstevenson5c",
|
||||
"/images/user1.png",
|
||||
"jordansteve@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"165"
|
||||
),
|
||||
createData(
|
||||
"Candice Munoz",
|
||||
"@candice3unoz",
|
||||
"/images/user2.png",
|
||||
"candicemunoz@gmail.com",
|
||||
"Administrator",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"120"
|
||||
),
|
||||
createData(
|
||||
"Mike Mcclain",
|
||||
"@mike4mcclain",
|
||||
"/images/user3.png",
|
||||
"mikemcclain@gmail.com",
|
||||
"Contributor",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"220"
|
||||
),
|
||||
createData(
|
||||
"Bernard Langley",
|
||||
"@bernardlangley",
|
||||
"/images/user4.png",
|
||||
"bernardlangley@gmail.com",
|
||||
"Agent",
|
||||
"Deactive",
|
||||
"dangerBadge",
|
||||
"122"
|
||||
),
|
||||
createData(
|
||||
"Kristie Hall",
|
||||
"@kristie7hall",
|
||||
"/images/user5.png",
|
||||
"kristiehall@gmail.com",
|
||||
"Contributor",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"360"
|
||||
),
|
||||
createData(
|
||||
"Bolton Obrien",
|
||||
"@bolton4obrien",
|
||||
"/images/user6.png",
|
||||
"boltonobrien@gmail.com",
|
||||
"Administrator",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"250"
|
||||
),
|
||||
createData(
|
||||
"Dee Alvarado",
|
||||
"@dee3alvarado",
|
||||
"/images/user7.png",
|
||||
"deealvarado@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"140"
|
||||
),
|
||||
createData(
|
||||
"Cervantes Kramer",
|
||||
"@cervantes4kramer",
|
||||
"/images/user8.png",
|
||||
"cervantes4kramer@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"345"
|
||||
),
|
||||
createData(
|
||||
"Dejesus Michael",
|
||||
"@dejesus1michael",
|
||||
"/images/user9.png",
|
||||
"dejesusmichael@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"323"
|
||||
),
|
||||
createData(
|
||||
"Alissa Nelson",
|
||||
"@alissa1nelson",
|
||||
"/images/user10.png",
|
||||
"alissa1nelson@gmail.com",
|
||||
"Agent",
|
||||
"Deactive",
|
||||
"dangerBadge",
|
||||
"451"
|
||||
),
|
||||
createData(
|
||||
"Milton",
|
||||
"@milton",
|
||||
"/images/user11.png",
|
||||
"milton@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"432"
|
||||
),
|
||||
createData(
|
||||
"Claude",
|
||||
"@claude",
|
||||
"/images/user12.png",
|
||||
"claude@gmail.com",
|
||||
"Agent",
|
||||
"Deactive",
|
||||
"dangerBadge",
|
||||
"543"
|
||||
),
|
||||
createData(
|
||||
"Joshua",
|
||||
"@joshua",
|
||||
"/images/user13.png",
|
||||
"joshua@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"543"
|
||||
),
|
||||
createData(
|
||||
"Harvey",
|
||||
"@harvey",
|
||||
"/images/user14.png",
|
||||
"harvey@gmail.com",
|
||||
"Agent",
|
||||
"Deactive",
|
||||
"dangerBadge",
|
||||
"432"
|
||||
),
|
||||
createData(
|
||||
"Antonio",
|
||||
"@antonio",
|
||||
"/images/user15.png",
|
||||
"antonio@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"765"
|
||||
),
|
||||
createData(
|
||||
"Julian",
|
||||
"@julian",
|
||||
"/images/user16.png",
|
||||
"julian@gmail.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"678"
|
||||
),
|
||||
createData(
|
||||
"Harold",
|
||||
"@harold",
|
||||
"/images/user17.png",
|
||||
"harold@gmail.com",
|
||||
"Agent",
|
||||
"Deactive",
|
||||
"dangerBadge",
|
||||
"165"
|
||||
),
|
||||
createData(
|
||||
"Kingston",
|
||||
"@kingston",
|
||||
"/images/user18.png",
|
||||
"kingston@info.com",
|
||||
"Agent",
|
||||
"Active",
|
||||
"successBadge",
|
||||
"165"
|
||||
),
|
||||
].sort((a, b) => (a.name < b.name ? -1 : 1));
|
||||
|
||||
export default function CustomersDetails() {
|
||||
// Table
|
||||
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);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px 20px 15px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
borderBottom: "1px solid #EEF0F7",
|
||||
paddingBottom: "10px",
|
||||
mb: "20px",
|
||||
}}
|
||||
className="for-dark-bottom-border"
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Customers Details
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<TableContainer
|
||||
component={Paper}
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
}}
|
||||
>
|
||||
<Table
|
||||
sx={{ minWidth: 900 }}
|
||||
aria-label="custom pagination table"
|
||||
className="dark-table"
|
||||
>
|
||||
<TableHead sx={{ background: "#F7FAFF" }}>
|
||||
<TableRow>
|
||||
<TableCell
|
||||
sx={{ borderBottom: "1px solid #F7FAFF", fontSize: "13.5px" }}
|
||||
>
|
||||
Name
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
sx={{ borderBottom: "1px solid #F7FAFF", fontSize: "13.5px" }}
|
||||
>
|
||||
Email
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
sx={{ borderBottom: "1px solid #F7FAFF", fontSize: "13.5px" }}
|
||||
>
|
||||
Rolls
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
sx={{ borderBottom: "1px solid #F7FAFF", fontSize: "13.5px" }}
|
||||
>
|
||||
Status
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
sx={{ borderBottom: "1px solid #F7FAFF", fontSize: "13.5px" }}
|
||||
>
|
||||
Projects
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="right"
|
||||
sx={{ borderBottom: "1px solid #F7FAFF", fontSize: "13.5px" }}
|
||||
>
|
||||
Action
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
|
||||
<TableBody>
|
||||
{(rowsPerPage > 0
|
||||
? rows.slice(
|
||||
page * rowsPerPage,
|
||||
page * rowsPerPage + rowsPerPage
|
||||
)
|
||||
: rows
|
||||
).map((row) => (
|
||||
<TableRow key={row.name}>
|
||||
<TableCell
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
paddingTop: "13px",
|
||||
paddingBottom: "13px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Checkbox {...label} size="small" />
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
ml: "10px",
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src={row.image}
|
||||
alt="User"
|
||||
width={40}
|
||||
height={40}
|
||||
className="borRadius100"
|
||||
/>
|
||||
<Box className="ml-10px">
|
||||
<Typography
|
||||
as="h4"
|
||||
sx={{
|
||||
fontWeight: "500",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
{row.name}
|
||||
</Typography>
|
||||
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "12px",
|
||||
color: "#A9A9C8",
|
||||
}}
|
||||
>
|
||||
{row.userName}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13px",
|
||||
paddingTop: "13px",
|
||||
paddingBottom: "13px",
|
||||
}}
|
||||
>
|
||||
{row.email}
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
paddingTop: "13px",
|
||||
paddingBottom: "13px",
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.rolls}
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
sx={{
|
||||
fontWeight: 500,
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "12px",
|
||||
padding: "8px 10px",
|
||||
}}
|
||||
>
|
||||
<span className={row.badgeClass}>{row.status}</span>
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
paddingTop: "13px",
|
||||
paddingBottom: "13px",
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.projects}
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="right"
|
||||
sx={{ borderBottom: "1px solid #F7FAFF" }}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "inline-block",
|
||||
}}
|
||||
>
|
||||
<Tooltip title="Remove" placement="top">
|
||||
<IconButton
|
||||
aria-label="remove"
|
||||
size="small"
|
||||
color="danger"
|
||||
className="danger"
|
||||
>
|
||||
<DeleteIcon fontSize="inherit" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip title="Rename" placement="top">
|
||||
<IconButton
|
||||
aria-label="rename"
|
||||
size="small"
|
||||
color="primary"
|
||||
className="primary"
|
||||
>
|
||||
<DriveFileRenameOutlineIcon fontSize="inherit" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
{emptyRows > 0 && (
|
||||
<TableRow style={{ height: 53 * emptyRows }}>
|
||||
<TableCell
|
||||
colSpan={5}
|
||||
style={{ borderBottom: "1px solid #F7FAFF" }}
|
||||
/>
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
|
||||
<TableFooter>
|
||||
<TableRow>
|
||||
<TablePagination
|
||||
rowsPerPageOptions={[5, 10, 25, { label: "All", value: -1 }]}
|
||||
colSpan={8}
|
||||
count={rows.length}
|
||||
rowsPerPage={rowsPerPage}
|
||||
page={page}
|
||||
SelectProps={{
|
||||
inputProps: {
|
||||
"aria-label": "rows per page",
|
||||
},
|
||||
native: true,
|
||||
}}
|
||||
onPageChange={handleChangePage}
|
||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||
ActionsComponent={CustomersDetail}
|
||||
style={{ borderBottom: "none" }}
|
||||
/>
|
||||
</TableRow>
|
||||
</TableFooter>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import React from "react";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Card from "@mui/material/Card";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { BarChart, Bar, XAxis, Tooltip, ResponsiveContainer } from "recharts";
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: "Sat",
|
||||
income: 24,
|
||||
},
|
||||
{
|
||||
name: "Sun",
|
||||
income: 13,
|
||||
},
|
||||
{
|
||||
name: "Mon",
|
||||
income: 98,
|
||||
},
|
||||
{
|
||||
name: "Tue",
|
||||
income: 39,
|
||||
},
|
||||
{
|
||||
name: "Wed",
|
||||
income: 48,
|
||||
},
|
||||
{
|
||||
name: "Thu",
|
||||
income: 38,
|
||||
},
|
||||
{
|
||||
name: "Fri",
|
||||
income: 43,
|
||||
},
|
||||
];
|
||||
|
||||
const NetIncome = () => {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "30px 20px 20px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Grid
|
||||
container
|
||||
alignItems="center"
|
||||
rowSpacing={1}
|
||||
columnSpacing={{ xs: 1, sm: 2, md: 2 }}
|
||||
>
|
||||
<Grid item xs={12} md={12} lg={6}>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
width: "46px",
|
||||
height: "54px",
|
||||
lineHeight: "54px",
|
||||
borderRadius: "8px",
|
||||
fontSize: "25px",
|
||||
background: "#FFFFFF",
|
||||
boxShadow: "0px 4px 20px rgba(117, 127, 239, 0.15)",
|
||||
color: "#757FEF",
|
||||
textAlign: "center",
|
||||
}}
|
||||
className="mr-15px"
|
||||
>
|
||||
<i className="ri-bar-chart-fill"></i>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Typography variant="p" sx={{ fontSize: 12 }}>
|
||||
Net Income
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h1"
|
||||
sx={{ fontSize: 20, fontWeight: 700, mt: "5px" }}
|
||||
>
|
||||
$438.5k
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={12} lg={6}>
|
||||
<ResponsiveContainer width="100%" aspect={2.0 / 0.9}>
|
||||
<BarChart
|
||||
width={500}
|
||||
height={300}
|
||||
data={data}
|
||||
margin={{
|
||||
top: 5,
|
||||
right: 10,
|
||||
left: 10,
|
||||
bottom: 5,
|
||||
}}
|
||||
barSize={8}
|
||||
>
|
||||
<XAxis
|
||||
dataKey="name"
|
||||
scale="point"
|
||||
fontSize={9}
|
||||
stroke="#A9A9C8"
|
||||
/>
|
||||
|
||||
<Tooltip wrapperStyle={{ fontSize: "14px" }} />
|
||||
|
||||
<Bar
|
||||
dataKey="income"
|
||||
fill="#757FEF"
|
||||
background={{ fill: "#DBDFF1" }}
|
||||
unit="k"
|
||||
/>
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default NetIncome;
|
||||
@@ -0,0 +1,132 @@
|
||||
import React from "react";
|
||||
import {
|
||||
BarChart,
|
||||
Bar,
|
||||
XAxis,
|
||||
Tooltip,
|
||||
ResponsiveContainer,
|
||||
} from "recharts";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Card from "@mui/material/Card";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: "Sat",
|
||||
visited: 2400,
|
||||
},
|
||||
{
|
||||
name: "Sun",
|
||||
visited: 1398,
|
||||
},
|
||||
{
|
||||
name: "Mon",
|
||||
visited: 9800,
|
||||
},
|
||||
{
|
||||
name: "Tue",
|
||||
visited: 3908,
|
||||
},
|
||||
{
|
||||
name: "Wed",
|
||||
visited: 4800,
|
||||
},
|
||||
{
|
||||
name: "Thu",
|
||||
visited: 3800,
|
||||
},
|
||||
{
|
||||
name: "Fri",
|
||||
visited: 4300,
|
||||
},
|
||||
];
|
||||
|
||||
const NewSessions = () => {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "30px 20px 20px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Grid container alignItems="center" rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 2 }}>
|
||||
<Grid item xs={12} md={12} lg={6}>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
width: "46px",
|
||||
height: "54px",
|
||||
lineHeight: "54px",
|
||||
borderRadius: "8px",
|
||||
fontSize: "25px",
|
||||
background: "#FFFFFF",
|
||||
boxShadow: "0px 4px 20px rgba(117, 127, 239, 0.15)",
|
||||
color: "#757FEF",
|
||||
textAlign: "center",
|
||||
}}
|
||||
className='mr-15px'
|
||||
>
|
||||
<i className="ri-time-line"></i>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Typography variant="p" sx={{ fontSize: 12 }}>
|
||||
New Sessions
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h1"
|
||||
sx={{ fontSize: 20, fontWeight: 700, mt: "5px" }}
|
||||
>
|
||||
1,500
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={12} lg={6}>
|
||||
<ResponsiveContainer width="100%" aspect={2.0 / 0.9}>
|
||||
<BarChart
|
||||
width={500}
|
||||
height={300}
|
||||
data={data}
|
||||
margin={{
|
||||
top: 5,
|
||||
right: 10,
|
||||
left: 10,
|
||||
bottom: 5,
|
||||
}}
|
||||
barSize={8}
|
||||
>
|
||||
<XAxis
|
||||
dataKey="name"
|
||||
scale="point"
|
||||
fontSize={9}
|
||||
stroke="#A9A9C8"
|
||||
/>
|
||||
|
||||
<Tooltip wrapperStyle={{fontSize: "14px"}} />
|
||||
|
||||
<Bar
|
||||
dataKey="visited"
|
||||
fill="#F765A3"
|
||||
background={{ fill: "#DBDFF1" }}
|
||||
/>
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default NewSessions;
|
||||
@@ -0,0 +1,132 @@
|
||||
import React from "react";
|
||||
import {
|
||||
BarChart,
|
||||
Bar,
|
||||
XAxis,
|
||||
Tooltip,
|
||||
ResponsiveContainer,
|
||||
} from "recharts";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Card from "@mui/material/Card";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: "Sat",
|
||||
visited: 2400,
|
||||
},
|
||||
{
|
||||
name: "Sun",
|
||||
visited: 1398,
|
||||
},
|
||||
{
|
||||
name: "Mon",
|
||||
visited: 9800,
|
||||
},
|
||||
{
|
||||
name: "Tue",
|
||||
visited: 3908,
|
||||
},
|
||||
{
|
||||
name: "Wed",
|
||||
visited: 4800,
|
||||
},
|
||||
{
|
||||
name: "Thu",
|
||||
visited: 3800,
|
||||
},
|
||||
{
|
||||
name: "Fri",
|
||||
visited: 4300,
|
||||
},
|
||||
];
|
||||
|
||||
const VisitsByDay = () => {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "30px 20px 20px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Grid container alignItems="center" rowSpacing={1} columnSpacing={{ xs: 1, sm: 2, md: 2 }}>
|
||||
<Grid item xs={12} md={12} lg={6}>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
width: "46px",
|
||||
height: "54px",
|
||||
lineHeight: "54px",
|
||||
borderRadius: "8px",
|
||||
fontSize: "25px",
|
||||
background: "#FFFFFF",
|
||||
boxShadow: "0px 4px 20px rgba(117, 127, 239, 0.15)",
|
||||
color: "#757FEF",
|
||||
textAlign: "center",
|
||||
}}
|
||||
className='mr-15px'
|
||||
>
|
||||
<i className="ri-pie-chart-line"></i>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Typography variant="p" sx={{ fontSize: 12 }}>
|
||||
Visits By Day
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h1"
|
||||
sx={{ fontSize: 20, fontWeight: 700, mt: "5px" }}
|
||||
>
|
||||
1,802
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} md={12} lg={6}>
|
||||
<ResponsiveContainer width="100%" aspect={2.0 / 0.9}>
|
||||
<BarChart
|
||||
width={500}
|
||||
height={300}
|
||||
data={data}
|
||||
margin={{
|
||||
top: 5,
|
||||
right: 10,
|
||||
left: 10,
|
||||
bottom: 5,
|
||||
}}
|
||||
barSize={8}
|
||||
>
|
||||
<XAxis
|
||||
dataKey="name"
|
||||
scale="point"
|
||||
fontSize={9}
|
||||
stroke="#A9A9C8"
|
||||
/>
|
||||
|
||||
<Tooltip wrapperStyle={{fontSize: "14px"}} />
|
||||
|
||||
<Bar
|
||||
dataKey="visited"
|
||||
fill="#FFBA69"
|
||||
background={{ fill: "#DBDFF1" }}
|
||||
/>
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default VisitsByDay;
|
||||
@@ -0,0 +1,36 @@
|
||||
.totalRevenueList {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #F7FAFF;
|
||||
margin-bottom: 13px;
|
||||
padding-bottom: 13px;
|
||||
}
|
||||
.totalRevenueList:last-child {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.totalRevenueList p {
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
}
|
||||
.totalRevenueList .rightContent {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.totalRevenueList .rightContent h5 {
|
||||
margin: 0 15px 0 0;
|
||||
font-size: 12px;
|
||||
color: #5B5B98;
|
||||
}
|
||||
.totalRevenueList .rightContent i {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
/* For dark mode */
|
||||
[class="dark"] .totalRevenueList {
|
||||
border-bottom: 1px solid var(--borderColor);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import React, { Component } from 'react';
|
||||
import dynamic from "next/dynamic";
|
||||
const Chart = dynamic(() => import("react-apexcharts"), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
class RevenueChart extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
series: [65],
|
||||
options: {
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
hollow: {
|
||||
size: "50%",
|
||||
},
|
||||
track: {
|
||||
background: "#ECEFF7",
|
||||
},
|
||||
dataLabels: {
|
||||
name: {
|
||||
show: true,
|
||||
fontSize: '12px',
|
||||
color: '#5B5B98',
|
||||
},
|
||||
value: {
|
||||
offsetY: 3,
|
||||
color: "#00B69B",
|
||||
fontSize: "16px",
|
||||
fontWeight: "500",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
labels: ['Revenue'],
|
||||
fill: {
|
||||
opacity: 1,
|
||||
colors: ["#757FEF"],
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<Chart
|
||||
options={this.state.options}
|
||||
series={this.state.series}
|
||||
height="175"
|
||||
type="radialBar"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default RevenueChart;
|
||||
@@ -0,0 +1,193 @@
|
||||
import React from "react";
|
||||
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 IconButton from "@mui/material/IconButton";
|
||||
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
|
||||
import RevenueChart from "./RevenueChart";
|
||||
import styles from "@/components/Analytics/Reports/AvarageReport/AvarageReportList.module.css";
|
||||
|
||||
const AvarageReport = () => {
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
const open = Boolean(anchorEl);
|
||||
const handleClick = (event) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
const handleClose = () => {
|
||||
setAnchorEl(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px 20px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
borderBottom: "1px solid #EEF0F7",
|
||||
paddingBottom: "10px",
|
||||
}}
|
||||
|
||||
className="for-dark-bottom-border"
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Avarage Report
|
||||
</Typography>
|
||||
|
||||
<Box>
|
||||
<IconButton
|
||||
onClick={handleClick}
|
||||
size="small"
|
||||
aria-controls={open ? "account-menu" : undefined}
|
||||
aria-haspopup="true"
|
||||
aria-expanded={open ? "true" : undefined}
|
||||
>
|
||||
<MoreHorizIcon />
|
||||
</IconButton>
|
||||
</Box>
|
||||
<Menu
|
||||
anchorEl={anchorEl}
|
||||
id="account-menu"
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
onClick={handleClose}
|
||||
PaperProps={{
|
||||
elevation: 0,
|
||||
sx: {
|
||||
overflow: "visible",
|
||||
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
||||
mt: 1.5,
|
||||
"& .MuiAvatar-root": {
|
||||
width: 32,
|
||||
height: 32,
|
||||
ml: -0.5,
|
||||
mr: 1,
|
||||
},
|
||||
"&:before": {
|
||||
content: '""',
|
||||
display: "block",
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
right: 14,
|
||||
width: 10,
|
||||
height: 10,
|
||||
bgcolor: "background.paper",
|
||||
transform: "translateY(-50%) rotate(45deg)",
|
||||
zIndex: 0,
|
||||
},
|
||||
},
|
||||
}}
|
||||
transformOrigin={{ horizontal: "right", vertical: "top" }}
|
||||
anchorOrigin={{ horizontal: "right", vertical: "bottom" }}
|
||||
>
|
||||
<MenuItem sx={{ fontSize: "14px" }}>Last 15 Days</MenuItem>
|
||||
<MenuItem sx={{ fontSize: "14px" }}>Last Month</MenuItem>
|
||||
<MenuItem sx={{ fontSize: "14px" }}>Last Year</MenuItem>
|
||||
</Menu>
|
||||
</Box>
|
||||
|
||||
{/* RevenueChart */}
|
||||
<RevenueChart />
|
||||
|
||||
<>
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Avg. Session</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>972</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-up-line successColor"></i> 49%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Conversion Rate</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>102</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-down-line dangerColor"></i> 18%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Avg. Duration</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>3m</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-up-line successColor"></i> 42%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Weekly Earning</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>$972</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-down-line dangerColor"></i> 28%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Monthly Revenue</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>50k</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-up-line successColor"></i> 70%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Order Rate</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>1026</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-down-line dangerColor"></i> 18%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Avg. Visitors</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>1.5k</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-up-line successColor"></i> 42%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.totalRevenueList}>
|
||||
<p>Avg. Sales</p>
|
||||
<div className={styles.rightContent}>
|
||||
<h5>1250k</h5>
|
||||
<p>
|
||||
<i className="ri-arrow-right-down-line dangerColor"></i> 42%
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default AvarageReport;
|
||||
@@ -0,0 +1,621 @@
|
||||
import React from "react";
|
||||
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 IconButton from "@mui/material/IconButton";
|
||||
import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
|
||||
import PropTypes from "prop-types";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import Table from "@mui/material/Table";
|
||||
import TableHead from "@mui/material/TableHead";
|
||||
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 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";
|
||||
|
||||
function BrowserUsedAndTrafficReport(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 (
|
||||
<Box sx={{ flexShrink: 0, ml: 2.5 }}>
|
||||
<IconButton
|
||||
onClick={handleFirstPageButtonClick}
|
||||
disabled={page === 0}
|
||||
aria-label="first page"
|
||||
>
|
||||
{theme.direction === "rtl" ? <LastPageIcon /> : <FirstPageIcon />}
|
||||
</IconButton>
|
||||
|
||||
<IconButton
|
||||
onClick={handleBackButtonClick}
|
||||
disabled={page === 0}
|
||||
aria-label="previous page"
|
||||
>
|
||||
{theme.direction === "rtl" ? (
|
||||
<KeyboardArrowRight />
|
||||
) : (
|
||||
<KeyboardArrowLeft />
|
||||
)}
|
||||
</IconButton>
|
||||
|
||||
<IconButton
|
||||
onClick={handleNextButtonClick}
|
||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||
aria-label="next page"
|
||||
>
|
||||
{theme.direction === "rtl" ? (
|
||||
<KeyboardArrowLeft />
|
||||
) : (
|
||||
<KeyboardArrowRight />
|
||||
)}
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={handleLastPageButtonClick}
|
||||
disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
||||
aria-label="last page"
|
||||
>
|
||||
{theme.direction === "rtl" ? <FirstPageIcon /> : <LastPageIcon />}
|
||||
</IconButton>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
BrowserUsedAndTrafficReport.propTypes = {
|
||||
count: PropTypes.number.isRequired,
|
||||
onPageChange: PropTypes.func.isRequired,
|
||||
page: PropTypes.number.isRequired,
|
||||
rowsPerPage: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
function createData(
|
||||
channel,
|
||||
sessions,
|
||||
sessionsProgress,
|
||||
prevPeriod,
|
||||
prevPeriodProgress,
|
||||
transactions,
|
||||
transactionsProgress,
|
||||
conRate,
|
||||
bounceRate,
|
||||
change,
|
||||
iconName,
|
||||
badgeClass
|
||||
) {
|
||||
return {
|
||||
channel,
|
||||
sessions,
|
||||
sessionsProgress,
|
||||
prevPeriod,
|
||||
prevPeriodProgress,
|
||||
transactions,
|
||||
transactionsProgress,
|
||||
conRate,
|
||||
bounceRate,
|
||||
change,
|
||||
iconName,
|
||||
badgeClass,
|
||||
};
|
||||
}
|
||||
|
||||
const rows = [
|
||||
createData(
|
||||
"Organic Search",
|
||||
"10853",
|
||||
"(52%)",
|
||||
"566",
|
||||
"(52%)",
|
||||
"566",
|
||||
"(52%)",
|
||||
"3.2%",
|
||||
"57.8%",
|
||||
"52.80%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Direct",
|
||||
"10844",
|
||||
"(50%)",
|
||||
"666",
|
||||
"(50%)",
|
||||
"766",
|
||||
"(50%)",
|
||||
"2.2%",
|
||||
"20.8%",
|
||||
"55.99%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Referal",
|
||||
"20844",
|
||||
"(60%)",
|
||||
"754",
|
||||
"(60%)",
|
||||
"899",
|
||||
"(60%)",
|
||||
"1.2%",
|
||||
"60.8%",
|
||||
"60.99%",
|
||||
"ri-arrow-down-s-fill",
|
||||
"dangerBadge"
|
||||
),
|
||||
createData(
|
||||
"Email",
|
||||
"15844",
|
||||
"(50%)",
|
||||
"764",
|
||||
"(50%)",
|
||||
"755",
|
||||
"(50%)",
|
||||
"4.2%",
|
||||
"30.8%",
|
||||
"50.99%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Social",
|
||||
"12844",
|
||||
"(50%)",
|
||||
"764",
|
||||
"(50%)",
|
||||
"755",
|
||||
"(50%)",
|
||||
"5.2%",
|
||||
"35.8%",
|
||||
"50.99%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Chrome",
|
||||
"5853",
|
||||
"(52%)",
|
||||
"466",
|
||||
"(52%)",
|
||||
"566",
|
||||
"(52%)",
|
||||
"6.2%",
|
||||
"40.8%",
|
||||
"52.80%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Safari",
|
||||
"2844",
|
||||
"(50%)",
|
||||
"766",
|
||||
"(50%)",
|
||||
"666",
|
||||
"(50%)",
|
||||
"3.2%",
|
||||
"55.8%",
|
||||
"55.00%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Edge",
|
||||
"1844",
|
||||
"(60%)",
|
||||
"454",
|
||||
"(60%)",
|
||||
"399",
|
||||
"(60%)",
|
||||
"7.2%",
|
||||
"10.8%",
|
||||
"60.00%",
|
||||
"ri-arrow-down-s-fill",
|
||||
"dangerBadge"
|
||||
),
|
||||
createData(
|
||||
"Firefox",
|
||||
"15844",
|
||||
"(55%)",
|
||||
"564",
|
||||
"(55%)",
|
||||
"455",
|
||||
"(55%)",
|
||||
"4.2%",
|
||||
"20.8%",
|
||||
"55.00%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
createData(
|
||||
"Opera",
|
||||
"11844",
|
||||
"(50%)",
|
||||
"864",
|
||||
"(50%)",
|
||||
"655",
|
||||
"(50%)",
|
||||
"3.2%",
|
||||
"32.8%",
|
||||
"50.00%",
|
||||
"ri-arrow-up-s-fill",
|
||||
"successBadge"
|
||||
),
|
||||
].sort((a, b) => (a.channel < b.channel ? -1 : 1));
|
||||
|
||||
const BrowserUsedAndTrafficReports = () => {
|
||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||
const open = Boolean(anchorEl);
|
||||
const handleClick = (event) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
const handleClose = () => {
|
||||
setAnchorEl(null);
|
||||
};
|
||||
|
||||
// Table
|
||||
const [page, setPage] = React.useState(0);
|
||||
const [rowsPerPage, setRowsPerPage] = React.useState(7);
|
||||
|
||||
// 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);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px 20px 15px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
paddingBottom: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Browser Used & Traffic Reports
|
||||
</Typography>
|
||||
|
||||
<Box>
|
||||
<IconButton
|
||||
onClick={handleClick}
|
||||
size="small"
|
||||
aria-controls={open ? "account-menu" : undefined}
|
||||
aria-haspopup="true"
|
||||
aria-expanded={open ? "true" : undefined}
|
||||
>
|
||||
<MoreHorizIcon />
|
||||
</IconButton>
|
||||
</Box>
|
||||
<Menu
|
||||
anchorEl={anchorEl}
|
||||
id="account-menu"
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
onClick={handleClose}
|
||||
PaperProps={{
|
||||
elevation: 0,
|
||||
sx: {
|
||||
overflow: "visible",
|
||||
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
||||
mt: 1.5,
|
||||
"& .MuiAvatar-root": {
|
||||
width: 32,
|
||||
height: 32,
|
||||
ml: -0.5,
|
||||
mr: 1,
|
||||
},
|
||||
"&:before": {
|
||||
content: '""',
|
||||
display: "block",
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
right: 14,
|
||||
width: 10,
|
||||
height: 10,
|
||||
bgcolor: "background.paper",
|
||||
transform: "translateY(-50%) rotate(45deg)",
|
||||
zIndex: 0,
|
||||
},
|
||||
},
|
||||
}}
|
||||
transformOrigin={{ horizontal: "right", vertical: "top" }}
|
||||
anchorOrigin={{ horizontal: "right", vertical: "bottom" }}
|
||||
>
|
||||
<MenuItem sx={{ fontSize: "14px" }}>Last 15 Days</MenuItem>
|
||||
<MenuItem sx={{ fontSize: "14px" }}>Last Month</MenuItem>
|
||||
<MenuItem sx={{ fontSize: "14px" }}>Last Year</MenuItem>
|
||||
</Menu>
|
||||
</Box>
|
||||
|
||||
<TableContainer
|
||||
component={Paper}
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
}}
|
||||
>
|
||||
<Table
|
||||
sx={{ minWidth: 800 }}
|
||||
aria-label="custom pagination table"
|
||||
className="dark-table"
|
||||
>
|
||||
<TableHead sx={{ background: "#F7FAFF" }}>
|
||||
<TableRow>
|
||||
<TableCell
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
Channel
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
Sessions
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
Prev.Period
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
Transactions
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
Con.Rate
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
Bounce Rate
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13.5px",
|
||||
}}
|
||||
>
|
||||
% Change
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
|
||||
<TableBody>
|
||||
{(rowsPerPage > 0
|
||||
? rows.slice(
|
||||
page * rowsPerPage,
|
||||
page * rowsPerPage + rowsPerPage
|
||||
)
|
||||
: rows
|
||||
).map((row) => (
|
||||
<TableRow key={row.channel}>
|
||||
<TableCell
|
||||
style={{
|
||||
fontWeight: "500",
|
||||
fontSize: "13px",
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
color: "#757FEF",
|
||||
}}
|
||||
>
|
||||
{row.channel}
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
color: "#5B5B98",
|
||||
fontWeight: "500",
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.sessions}{" "}
|
||||
<Typography
|
||||
as="span"
|
||||
sx={{ color: "#A9A9C8", fontSize: "13px" }}
|
||||
>
|
||||
{row.sessionsProgress}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
color: "#5B5B98",
|
||||
fontWeight: "500",
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.prevPeriod}{" "}
|
||||
<Typography
|
||||
as="span"
|
||||
sx={{ color: "#A9A9C8", fontSize: "13px" }}
|
||||
>
|
||||
{row.prevPeriodProgress}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
color: "#5B5B98",
|
||||
fontWeight: "500",
|
||||
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.transactions}{" "}
|
||||
<Typography
|
||||
as="span"
|
||||
sx={{ color: "#A9A9C8", fontSize: "13px" }}
|
||||
>
|
||||
{row.transactionsProgress}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
color: "#5B5B98",
|
||||
fontWeight: "500",
|
||||
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.conRate}
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
color: "#5B5B98",
|
||||
fontWeight: "500",
|
||||
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
{row.bounceRate}
|
||||
</TableCell>
|
||||
|
||||
<TableCell
|
||||
align="center"
|
||||
style={{
|
||||
fontWeight: 500,
|
||||
borderBottom: "1px solid #F7FAFF",
|
||||
fontSize: "13px",
|
||||
}}
|
||||
>
|
||||
<span className={row.badgeClass}>
|
||||
{row.change}{" "}
|
||||
<i
|
||||
className={row.iconName}
|
||||
style={{
|
||||
fontSize: "17px",
|
||||
position: "relative",
|
||||
top: "4px",
|
||||
lineHeight: "1",
|
||||
fontWight: "bold",
|
||||
}}
|
||||
></i>
|
||||
</span>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
{emptyRows > 0 && (
|
||||
<TableRow style={{ height: 53 * emptyRows }}>
|
||||
<TableCell
|
||||
colSpan={5}
|
||||
style={{ borderBottom: "1px solid #F7FAFF" }}
|
||||
/>
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
|
||||
<TableFooter>
|
||||
<TableRow>
|
||||
<TablePagination
|
||||
rowsPerPageOptions={[5, 10, 25, { label: "All", value: -1 }]}
|
||||
colSpan={8}
|
||||
count={rows.length}
|
||||
rowsPerPage={rowsPerPage}
|
||||
page={page}
|
||||
SelectProps={{
|
||||
inputProps: {
|
||||
"aria-label": "rows per page",
|
||||
},
|
||||
native: true,
|
||||
}}
|
||||
onPageChange={handleChangePage}
|
||||
onRowsPerPageChange={handleChangeRowsPerPage}
|
||||
ActionsComponent={BrowserUsedAndTrafficReport}
|
||||
style={{ borderBottom: "none" }}
|
||||
/>
|
||||
</TableRow>
|
||||
</TableFooter>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default BrowserUsedAndTrafficReports;
|
||||
Reference in New Issue
Block a user