import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { Col, Label, Row } from "reactstrap"; import DataTable from "react-data-table-component"; import { editNumbers } from "../edit-numbers"; import { VerticalBarChart } from "../graphics"; import PdfHeader from "../pdf-header"; const WasteGraphics = ({ wasteData, isPDFDownloading, hideTables, colors, hideComponents, handleCheckboxChange, areaName, year, }) => { const { t } = useTranslation(); const [filterSubSector, setFilterSubSector] = useState({}); const serverSideColumnsOfWaste = [ { name: t("EmissionSources.subSector"), selector: (row) => row.subSector, sortable: false, cell: (row) => ( {row.subSector?.tag || "-"} ), }, { name: `Sera Gazı Miktarı (${t("DataInput.total")} tCO₂e)`, selector: (row) => row.totalEmission, sortable: false, cell: (row) => ( {editNumbers(row.totalEmission) || "-"} ), }, { name: `${t("Oransal Dağılım")} %`, selector: (row) => row.percentage, sortable: false, cell: (row) => ( {row.percentage + "%" || "-"} ), }, ]; useEffect(() => { const initialFilterSubSector = wasteData .filter((data) => data.subSector.tag !== "Genel Toplam") .reduce((acc, data) => { return { ...acc, [data.subSector.tag]: true, }; }, {}); setFilterSubSector(initialFilterSubSector); }, []); return (
{t("DataInput.report")} {t("Warnings.notFound")}
} customStyles={ isPDFDownloading ? { rows: { fontSize: "25px", }, headCells: { style: { fontSize: "23px", }, }, } : "" } /> )}