import { useState } from "react";
import { useTheme } from "../../contexts/ThemeContext";
import { Tabs, Tab, Modal, Button } from "react-bootstrap";
import FinancialDashboard from "../../components/FinancialDashboard/FinancialDashboard";
import AppointmentDashboard from "../../components/AppointmentDashboard/AppointmentDashboard";
import styles from "./AnalyticsModal.module.css";
const AnalyticsModal = () => {
const { theme } = useTheme();
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
// const income = 40407.17;
const expenses = 39985.23;
const monthdata = [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 141, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 2, 29, 30, 31,
];
const monthMaxValue = Math.max(...monthdata);
const MonthChartData = {
labels: [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26",
"27",
"28",
"29",
"30",
"31",
],
datasets: [
{
data: monthdata,
backgroundColor: "#3576C3",
categoryPercentage: 0.5,
borderRadius: 3,
responsive: true,
},
],
};
const MonthLeftCardData = {
label: "Total for the period",
value: expenses,
};
const MonthRightCardData = {
label: "Daily average",
value: expenses / monthdata.length,
};
const MonthChartOptions = {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
display: false,
beginAtZero: true,
max: monthMaxValue * 1.1,
},
x: {
grid: {
display: false,
drawBorder: false,
},
ticks: {
color: "#6b7280",
font: {
size: 12,
weight: "500",
},
},
},
},
plugins: {
legend: {
display: false,
},
tooltip: {
// enabled: true,
callbacks: {
// title: function (context) {
// // Customize the tooltip title
// return `${context[0].label}`;
// },
label: function (context) {
// Customize the tooltip label
let label = context.dataset.label || "";
if (label) {
label += ": ";
}
if (context.parsed.y !== null) {
label += `${context.parsed.y} ₽`;
}
return label;
},
},
},
},
};
return (
<>
Analytics
>
);
};
export default AnalyticsModal;