import { useMemo, ReactNode } from "react" // @mui material components import Card from "@mui/material/Card" import Divider from "@mui/material/Divider" import Icon from "@mui/material/Icon" // ThreeD Garden components import MDBox from "~/components/mui/MDBox" import MDTypography from "~/components/mui/MDTypography" // ReportsLineChart configurations import configs from "~/components/elements/Charts/LineCharts/ReportsLineChart/configs" // react-chartjs-2 components import { Line } from "react-chartjs-2" import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend } from "chart.js" ChartJS.register( CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend ) // Declaring props types for ReportsLineChart interface Props { color?: | "primary" | "secondary" | "info" | "success" | "warning" | "error" | "dark" title: string description?: string | ReactNode date: string chart: { labels: string[] datasets: { label: string data: number[] } } [key: string]: any } function ReportsLineChart({ color, title, description, date, chart, }: Props): JSX.Element { const { data, options } = configs(chart.labels || [], chart.datasets || {}) return ( {useMemo( () => ( {/* options={options} */} ), [chart, color] )} {title} {description} schedule {date} ) } // Declaring default props for ReportsLineChart ReportsLineChart.defaultProps = { color: "dark", description: "", } export default ReportsLineChart