2026-08-07 10:44:03 +07:00
|
|
|
import { getActivity, getDashboardStats } from "@/lib/api/server";
|
2026-08-15 17:53:48 +07:00
|
|
|
import { DashboardView } from "./view";
|
|
|
|
|
|
|
|
|
|
export const dynamic = "force-dynamic";
|
2026-07-26 11:27:21 +07:00
|
|
|
|
2026-08-07 10:44:03 +07:00
|
|
|
export default async function DashboardPage() {
|
2026-08-15 20:03:55 +07:00
|
|
|
let stats: Awaited<ReturnType<typeof getDashboardStats>> | undefined;
|
|
|
|
|
let activity: Awaited<ReturnType<typeof getActivity>> | undefined;
|
2026-08-15 17:53:48 +07:00
|
|
|
try {
|
2026-08-15 20:03:55 +07:00
|
|
|
[stats, activity] = await Promise.all([
|
|
|
|
|
getDashboardStats(),
|
|
|
|
|
getActivity(14),
|
|
|
|
|
]);
|
2026-08-15 17:53:48 +07:00
|
|
|
} catch {
|
|
|
|
|
// Backend unavailable — client hooks will surface the error state.
|
|
|
|
|
}
|
|
|
|
|
return <DashboardView initialStats={stats} initialActivity={activity} />;
|
2026-07-26 11:27:21 +07:00
|
|
|
}
|