FPSMS-frontend
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

49 líneas
1.3 KiB

  1. import { authOptions } from "@/config/authConfig";
  2. import { getServerSession, Session } from "next-auth";
  3. import DashboardPage from "./DashboardPage";
  4. import { Typography } from "@mui/material";
  5. import { I18nProvider, getServerI18n } from "@/i18n";
  6. import DashboardLoading from "./DashboardLoading";
  7. import { fetchEscalationLogsByUser } from "@/app/api/escalation";
  8. // import { fetchIqcLogByUser } from "@/app/api/dashboard";
  9. // export type SessionWithAbilities = {
  10. // abilities: string[]
  11. // } & Session | null
  12. interface SubComponents {
  13. Loading: typeof DashboardLoading;
  14. }
  15. type Props = {
  16. searchParams: { [key: string]: string | string[] | undefined };
  17. };
  18. const DashboardWrapper: React.FC<Props> & SubComponents = async ({
  19. searchParams,
  20. }) => {
  21. const { t } = await getServerI18n("dashboard");
  22. // const session: SessionWithAbilities = await getServerSession(authOptions)
  23. // const [iqcLog] = await Promise.all([
  24. // fetchIqcLogByUser()
  25. // ])
  26. const [escalationLogs] = await Promise.all([
  27. fetchEscalationLogsByUser()
  28. ])
  29. return (
  30. <>
  31. <Typography variant="h4">{t("Dashboard")}</Typography>
  32. <DashboardPage
  33. escalationLogs={escalationLogs}
  34. // iqc={iqcLog}
  35. // abilities={session ? session?.abilities : []}
  36. />
  37. </>
  38. );
  39. };
  40. DashboardWrapper.Loading = DashboardLoading;
  41. export default DashboardWrapper;