import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { UsersFourIcon } from "@phosphor-icons/react";
import { useNeighborhoodDemographics } from "~/sdks/NeighborhoodDemographics/context";
import { DemographicsTextCard } from "~/components/DemographicsTextCard";
export const TotalPopulation = () => {
    const { t } = useTranslation("neighborhoodDemographics");
    const { demographicsData: { population_total: populationTotal }, } = useNeighborhoodDemographics();
    const dataset = useMemo(() => populationTotal === null || populationTotal === void 0 ? void 0 : populationTotal.variables[0], [populationTotal === null || populationTotal === void 0 ? void 0 : populationTotal.variables]);
    const chartOptions = useMemo(() => ({
        options: {
            title: t("data.population.graphs.totalPopulation.title"),
            values: [
                {
                    variable: (dataset === null || dataset === void 0 ? void 0 : dataset.variable) || "",
                    value: `${new Intl.NumberFormat("en-EN").format(Math.round((dataset === null || dataset === void 0 ? void 0 : dataset.value) || 0))}`,
                    label: t("data.population.graphs.totalPopulation.title"),
                    icon: UsersFourIcon,
                },
            ],
        },
    }), [dataset]);
    return React.createElement(DemographicsTextCard, Object.assign({}, chartOptions));
};
//# sourceMappingURL=index.js.map