27 lines
1004 B
TypeScript
27 lines
1004 B
TypeScript
import type { Metadata } from "next";
|
|
import { redirect } from "next/navigation";
|
|
import { TopNav } from "@/components/navigation/top-nav";
|
|
import { prisma } from "@/lib/db/prisma";
|
|
import { getActingStaff } from "@/lib/staff/get-acting-staff";
|
|
import { listInAppNotifications } from "@/services/notifications/notification.service";
|
|
import { NotificationList } from "@/features/notifications/components/notification-list";
|
|
|
|
export const metadata: Metadata = { title: "Notifications" };
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function StaffNotificationsPage() {
|
|
const staff = await getActingStaff();
|
|
if (!staff) redirect("/home");
|
|
|
|
const notifications = await listInAppNotifications(prisma, { userId: staff.userId });
|
|
|
|
return (
|
|
<div className="pb-12">
|
|
<TopNav title="Notifications" onBack sticky className="bg-stone" />
|
|
<main className="mx-auto max-w-2xl px-6 py-6">
|
|
<NotificationList notifications={notifications} />
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|