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.
 
 

35 line
875 B

  1. import { Metadata } from "next";
  2. import { I18nProvider } from "@/i18n";
  3. import UserWorkspacePage from "@/components/UserWorkspacePage";
  4. import {
  5. fetchLeaveTypes,
  6. fetchLeaves,
  7. fetchTimesheets,
  8. } from "@/app/api/timesheets";
  9. import { authOptions } from "@/config/authConfig";
  10. import { getServerSession } from "next-auth";
  11. import { fetchAssignedProjects } from "@/app/api/projects";
  12. export const metadata: Metadata = {
  13. title: "User Workspace",
  14. };
  15. const Home: React.FC = async () => {
  16. const session = await getServerSession(authOptions);
  17. // Get name for caching
  18. const username = session!.user!.name!;
  19. fetchTimesheets(username);
  20. fetchAssignedProjects(username);
  21. fetchLeaves(username);
  22. fetchLeaveTypes();
  23. return (
  24. <I18nProvider namespaces={["home"]}>
  25. <UserWorkspacePage username={username} />
  26. </I18nProvider>
  27. );
  28. };
  29. export default Home;