You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 line
1017 B

  1. //src\components\LateStartReportGen\LateStartReportGenWrapper.tsx
  2. import { fetchProjectsFinancialStatus, fetchTeamCombo } from "@/app/api/reporte1";
  3. import React from "react";
  4. import FinancialStatusReportGen from "./FinancialStatusReportGen";
  5. import FinancialStatusReportGenLoading from "./FinancialStatusReportGenLoading";
  6. import { getUserStaff } from "@/app/utils/commonUtil";
  7. interface SubComponents {
  8. Loading: typeof FinancialStatusReportGenLoading;
  9. }
  10. const FinancialStatusReportGenWrapper: React.FC & SubComponents = async () => {
  11. const clentprojects = await fetchProjectsFinancialStatus();
  12. const [teamCombo, userStaff] = await Promise.all([fetchTeamCombo(), getUserStaff()])
  13. return <FinancialStatusReportGen projects={clentprojects} userStaff={userStaff} teamCombo={!Boolean(userStaff?.isTeamLead) ? teamCombo : teamCombo.filter(team => team.id === userStaff?.teamId)}/>;
  14. };
  15. FinancialStatusReportGenWrapper.Loading = FinancialStatusReportGenLoading;
  16. export default FinancialStatusReportGenWrapper;