2026-08-07 10:44:03 +07:00
|
|
|
/**
|
2026-08-14 10:49:44 +07:00
|
|
|
* Moderation — Server Component.
|
|
|
|
|
* Seeds moderation stats + action log for SSR first paint; live via WS.
|
2026-08-07 10:44:03 +07:00
|
|
|
*/
|
|
|
|
|
import { getModerationActions, getModerationStats } from "@/lib/api/server";
|
2026-08-14 10:49:44 +07:00
|
|
|
import ModerationView from "./view";
|
2026-08-07 10:44:03 +07:00
|
|
|
|
|
|
|
|
export default async function ModerationPage() {
|
|
|
|
|
const [stats, actions] = await Promise.allSettled([
|
2026-08-14 10:49:44 +07:00
|
|
|
getModerationStats().catch(() => undefined),
|
|
|
|
|
getModerationActions(100).catch(() => undefined),
|
2026-08-07 10:44:03 +07:00
|
|
|
]);
|
2026-08-05 11:11:10 +07:00
|
|
|
return (
|
2026-08-14 10:49:44 +07:00
|
|
|
<ModerationView
|
|
|
|
|
initialStats={
|
|
|
|
|
stats.status === "fulfilled" && stats.value ? stats.value : undefined
|
|
|
|
|
}
|
|
|
|
|
initialActions={
|
|
|
|
|
actions.status === "fulfilled" && actions.value
|
|
|
|
|
? actions.value
|
|
|
|
|
: undefined
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-08-05 11:11:10 +07:00
|
|
|
);
|
|
|
|
|
}
|