import "./StatisticsSection.scss"; import { apiInstance } from "@/shared/config/apiConfig"; import { useTranslations } from "next-intl"; import { getTranslations } from "next-intl/server"; interface ICategoryStatistics { category: number; total: number; } const StatisticsSection = async () => { const t = await getTranslations("general"); const getCategoryStatistics = async () => { const res = await apiInstance.get( "/report/category_count/" ); return res.data; }; const statistics = await getCategoryStatistics(); const ROAD_TYPES_STATS: Record = { 1: t("broken_roads"), 2: t("accident_hotspots"), 3: t("local_defects"), 4: t("repair_plans"), 5: t("repaired"), 6: t("fixed_local_defects"), }; return (
    {statistics.map((cat) => (
  • {ROAD_TYPES_STATS[cat.category]}

    {cat.total}
  • ))}
); }; export default StatisticsSection;