import { DashboardBuilder } from "@/components/dashboards/dashboard-builder"
import { requireStaffSession } from "@/lib/auth-server"

type PageProps = {
  params?: Promise<{ id: string }>
}

export const dynamic = "force-dynamic"

export default async function DashboardPrintPage({ params }: PageProps) {
  if (!params) {
    throw new Error("Dashboard id not provided")
  }

  const { id } = await params

  await requireStaffSession()
  return (
    <div className="min-h-screen bg-white p-6" data-dashboard-print>
      <DashboardBuilder dashboardId={id} editable={false} mode="print" />
    </div>
  )
}
