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.
 
 

74 line
1.9 KiB

  1. import { fetchAllTasks, fetchTaskTemplates } from "@/app/api/tasks";
  2. import CreateProject from "./CreateProject";
  3. import {
  4. fetchProjectBuildingTypes,
  5. fetchProjectCategories,
  6. fetchProjectContractTypes,
  7. fetchProjectFundingTypes,
  8. fetchProjectLocationTypes,
  9. fetchProjectServiceTypes,
  10. fetchProjectWorkNatures,
  11. } from "@/app/api/projects";
  12. import { fetchStaff, fetchTeamLeads } from "@/app/api/staff";
  13. import { fetchAllCustomers, fetchAllSubsidiaries } from "@/app/api/customer";
  14. const CreateProjectWrapper: React.FC = async () => {
  15. const [
  16. tasks,
  17. taskTemplates,
  18. projectCategories,
  19. teamLeads,
  20. allCustomers,
  21. allSubsidiaries,
  22. contractTypes,
  23. fundingTypes,
  24. locationTypes,
  25. serviceTypes,
  26. buildingTypes,
  27. workNatures,
  28. allStaffs,
  29. ] = await Promise.all([
  30. fetchAllTasks(),
  31. fetchTaskTemplates(),
  32. fetchProjectCategories(),
  33. fetchTeamLeads(),
  34. fetchAllCustomers(),
  35. fetchAllSubsidiaries(),
  36. fetchProjectContractTypes(),
  37. fetchProjectFundingTypes(),
  38. fetchProjectLocationTypes(),
  39. fetchProjectServiceTypes(),
  40. fetchProjectBuildingTypes(),
  41. fetchProjectWorkNatures(),
  42. fetchStaff(),
  43. ]);
  44. return (
  45. <CreateProject
  46. allTasks={tasks}
  47. projectCategories={projectCategories}
  48. taskTemplates={taskTemplates}
  49. teamLeads={teamLeads}
  50. allSubsidiaries={allSubsidiaries}
  51. allCustomers={allCustomers}
  52. contractTypes={contractTypes}
  53. fundingTypes={fundingTypes}
  54. locationTypes={locationTypes}
  55. serviceTypes={serviceTypes}
  56. buildingTypes={buildingTypes}
  57. workNatures={workNatures}
  58. allStaffs={allStaffs}
  59. // Mocks
  60. grades={[
  61. { name: "Grade 1", id: 1, code: "1" },
  62. { name: "Grade 2", id: 2, code: "2" },
  63. { name: "Grade 3", id: 3, code: "3" },
  64. { name: "Grade 4", id: 4, code: "4" },
  65. { name: "Grade 5", id: 5, code: "5" },
  66. ]}
  67. />
  68. );
  69. };
  70. export default CreateProjectWrapper;