import PieChart from './PieChart'; import BarChart from './BarChart'; export interface Props { type: 'PieChart' | 'BarChart'; chartData: { datasets: { data: number[]; backgroundColor: string[]; toolTipMailArray: string[]; userLegendMailArray: string[]; count: number[]; }[]; labels: string[]; }; legendHeight: string; legendTitle: string; legendSubtitle: string; legendTitleColor: string; chartSize: string; legend: boolean; legendSubTitleValue: number; centerText: boolean; legeContainerWidth: string; chartHeight: string; chartWidth: string; toolTipText: string; isLegendUser: boolean; xAxisLabel: string; yAxisLabel: string; } const Chart = ({ type = 'PieChart', chartData, legend, legendSubTitleValue, legendHeight, legendTitle, legendTitleColor, legendSubtitle, chartSize, centerText, legeContainerWidth, chartHeight, chartWidth, toolTipText, isLegendUser, xAxisLabel, yAxisLabel, }: Props) => { const mode = type === 'PieChart' ? 'PieChart' : 'BarChart'; if (mode === 'PieChart') { return ( ); } return ( ); }; export default Chart;