25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
819 B

  1. import { fetchTeamProjects } from "@/app/api/teamprojects";
  2. import React from "react";
  3. import ProgressByTeamSearch from "./ProgressByTeamSearch";
  4. import ProgressByTeamSearchLoading from "./ProgressByTeamSearchLoading";
  5. interface SubComponents {
  6. Loading: typeof ProgressByTeamSearchLoading;
  7. }
  8. const ProgressByTeamSearchWrapper: React.FC & SubComponents = async () => {
  9. const teamprojects = await fetchTeamProjects();
  10. const _teamprojects = teamprojects.length > 1 ? [{id: 0, teamId: 0, teamLeadId: 0, teamCode: "All", teamName: "", projectNo: teamprojects.reduce((acc, cur) => acc + cur.projectNo, 0)}, ...teamprojects] : teamprojects
  11. return <ProgressByTeamSearch projects={_teamprojects} />;
  12. };
  13. ProgressByTeamSearchWrapper.Loading = ProgressByTeamSearchLoading;
  14. export default ProgressByTeamSearchWrapper;