import { Chart as ChartComponent, type ChartProps } from 'react-chartjs-2';

import { Chart, LinearScale, Tooltip } from 'chart.js';
import { TreemapController, TreemapElement } from 'chartjs-chart-treemap';

Chart.register(TreemapController, TreemapElement, LinearScale, Tooltip);

const TreemapChart = (props: Omit<ChartProps, 'type'>) => {
  return (
    <ChartComponent
      type="treemap"
      {...props}
    />
  );
};

export default TreemapChart;
