kleros/kleros-v2

View on GitHub
web/src/pages/Home/CourtOverview/CasesByCourtsChart.tsx

Summary

Maintainability
A
2 hrs
Test Coverage
import React from "react";
import BarChart, { IBarChartData } from "./BarChart";

export type CasesByCourtsChartData = { labels: string[]; cases: number[]; totalCases: number };

interface ICasesByCourtsChart {
  data: CasesByCourtsChartData;
}

const CasesByCourtsChart: React.FC<ICasesByCourtsChart> = ({ data }) => {
  const chartData: IBarChartData = {
    labels: data.labels,
    data: data.cases,
    total: data.totalCases,
  };

  return <BarChart chartData={chartData} />;
};

export default CasesByCourtsChart;