import React from "react";
import { fetchAllCustomers } from "@/app/api/customer";
import { fetchTeam } from "@/app/api/team";
import CostAndExpenseReport from "./CostAndExpenseReport";
import CostAndExpenseReportLoading from "./CostAndExpenseReportLoading";

interface SubComponents {
  Loading: typeof CostAndExpenseReportLoading;
}

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

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

CostAndExpenseReportWrapper.Loading = CostAndExpenseReportLoading;

export default CostAndExpenseReportWrapper;