import React from "react";
import ResourceOvercomsumptionReportLoading from "./ResourceOverconsumptionReportLoading";
import ResourceOverconsumptionReport from "./ResourceOverconsumptionReport";
import { fetchAllCustomers } from "@/app/api/customer";
import { fetchTeam } from "@/app/api/team";

interface SubComponents {
  Loading: typeof ResourceOvercomsumptionReportLoading;
}

const ResourceOvercomsumptionReportWrapper: React.FC & SubComponents = async () => {
  const customers = await fetchAllCustomers()
  const teams = await fetchTeam ()

  return <ResourceOverconsumptionReport team={teams} customer={customers}/>;
};

ResourceOvercomsumptionReportWrapper.Loading = ResourceOvercomsumptionReportLoading;

export default ResourceOvercomsumptionReportWrapper;