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.
 
 

54 rivejä
1.2 KiB

  1. import {
  2. fetchAssignedProjects,
  3. fetchProjectWithTasks,
  4. } from "@/app/api/projects";
  5. import UserWorkspacePage from "./UserWorkspacePage";
  6. import {
  7. fetchLeaveTypes,
  8. fetchLeaves,
  9. fetchTeamMemberTimesheets,
  10. fetchTimesheets,
  11. } from "@/app/api/timesheets";
  12. import { fetchHolidays } from "@/app/api/holidays";
  13. interface Props {
  14. username: string;
  15. }
  16. const UserWorkspaceWrapper: React.FC<Props> = async ({ username }) => {
  17. const [
  18. teamTimesheets,
  19. assignedProjects,
  20. allProjects,
  21. timesheets,
  22. leaves,
  23. leaveTypes,
  24. holidays,
  25. ] = await Promise.all([
  26. fetchTeamMemberTimesheets(username),
  27. fetchAssignedProjects(username),
  28. fetchProjectWithTasks(),
  29. fetchTimesheets(username),
  30. fetchLeaves(username),
  31. fetchLeaveTypes(),
  32. fetchHolidays(),
  33. ]);
  34. return (
  35. <UserWorkspacePage
  36. teamTimesheets={teamTimesheets}
  37. allProjects={allProjects}
  38. assignedProjects={assignedProjects}
  39. username={username}
  40. defaultTimesheets={timesheets}
  41. defaultLeaveRecords={leaves}
  42. leaveTypes={leaveTypes}
  43. holidays={holidays}
  44. // Change to access check
  45. fastEntryEnabled={true}
  46. />
  47. );
  48. };
  49. export default UserWorkspaceWrapper;