|
|
@@ -4,7 +4,8 @@ import DashboardPage from "./DashboardPage"; |
|
|
|
import { Typography } from "@mui/material"; |
|
|
|
import { I18nProvider, getServerI18n } from "@/i18n"; |
|
|
|
import DashboardLoading from "./DashboardLoading"; |
|
|
|
import { fetchIqcLogByUser } from "@/app/api/dashboard"; |
|
|
|
import { fetchEscalationLogsByUser } from "@/app/api/escalation"; |
|
|
|
// import { fetchIqcLogByUser } from "@/app/api/dashboard"; |
|
|
|
|
|
|
|
// export type SessionWithAbilities = { |
|
|
|
// abilities: string[] |
|
|
@@ -23,16 +24,20 @@ const DashboardWrapper: React.FC<Props> & SubComponents = async ({ |
|
|
|
}) => { |
|
|
|
const { t } = await getServerI18n("dashboard"); |
|
|
|
// const session: SessionWithAbilities = await getServerSession(authOptions) |
|
|
|
const [iqcLog] = await Promise.all([ |
|
|
|
fetchIqcLogByUser() |
|
|
|
// const [iqcLog] = await Promise.all([ |
|
|
|
// fetchIqcLogByUser() |
|
|
|
// ]) |
|
|
|
|
|
|
|
const [escalationLogs] = await Promise.all([ |
|
|
|
fetchEscalationLogsByUser() |
|
|
|
]) |
|
|
|
|
|
|
|
console.log(iqcLog) |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<Typography variant="h4">{t("Dashboard")}</Typography> |
|
|
|
<DashboardPage |
|
|
|
iqc={iqcLog} |
|
|
|
escalationLogs={escalationLogs} |
|
|
|
// iqc={iqcLog} |
|
|
|
// abilities={session ? session?.abilities : []} |
|
|
|
/> |
|
|
|
</> |
|
|
|