import { NotificationHistoryPage } from "@/components/notifications/notification-history-page"
import { DEFAULT_HISTORY_PAGE_SIZE } from "./_lib/notifications-filters"
import { fetchNotificationHistory } from "./_lib/notifications-server-api"

export default async function NotificationsRoute() {
  const { errorMessage, ...history } = await fetchNotificationHistory({
    status: "all",
    severity: "",
    module: "",
    q: "",
    page: 1,
    pageSize: DEFAULT_HISTORY_PAGE_SIZE,
  })

  return <NotificationHistoryPage initialHistory={history} initialErrorMessage={errorMessage} />
}
