import type { CardProps } from '@mui/material/Card'; import type { ChartOptions } from 'src/components/chart'; import Card from '@mui/material/Card'; import Divider from '@mui/material/Divider'; import { useTheme } from '@mui/material/styles'; import CardHeader from '@mui/material/CardHeader'; import { Chart, useChart, ChartLegends } from 'src/components/chart'; // ---------------------------------------------------------------------- type Props = CardProps & { title?: string; subheader?: string; chart: { colors?: string[]; categories: string[]; series: { name: string; data: number[]; }[]; options?: ChartOptions; }; }; export function AnalyticsCurrentSubject({ title, subheader, chart, sx, ...other }: Props) { const theme = useTheme(); const chartColors = chart.colors ?? [ theme.palette.primary.main, theme.palette.warning.main, theme.palette.info.main, ]; const chartOptions = useChart({ colors: chartColors, stroke: { width: 2 }, fill: { opacity: 0.48 }, xaxis: { categories: chart.categories, labels: { style: { colors: Array.from({ length: 6 }, () => theme.palette.text.secondary) } }, }, ...chart.options, }); return ( item.name)} colors={chartOptions?.colors} sx={{ p: 3, justifyContent: 'center' }} /> ); }