fix: switch production build to webpack
This commit is contained in:
parent
1079111de2
commit
ea8612b8fd
7 changed files with 48 additions and 31 deletions
|
|
@ -4,15 +4,23 @@ import { SiteHeader } from "@/components/site-header"
|
|||
import { requireStaffSession } from "@/lib/auth-server"
|
||||
|
||||
type PageProps = {
|
||||
params: { id: string }
|
||||
searchParams: { [key: string]: string | string[] | undefined }
|
||||
params?: Promise<{ id: string }>
|
||||
searchParams?: Promise<{ [key: string]: string | string[] | undefined }>
|
||||
}
|
||||
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
export default async function DashboardDetailPage({ params, searchParams }: PageProps) {
|
||||
if (!params) {
|
||||
throw new Error("Dashboard id not provided")
|
||||
}
|
||||
|
||||
const { id } = await params
|
||||
const resolvedSearchParams =
|
||||
(searchParams ? await searchParams : {}) as Record<string, string | string[] | undefined>
|
||||
|
||||
await requireStaffSession()
|
||||
const tvMode = searchParams?.tv === "1"
|
||||
const tvMode = resolvedSearchParams?.tv === "1"
|
||||
|
||||
return (
|
||||
<AppShell
|
||||
|
|
@ -25,7 +33,7 @@ export default async function DashboardDetailPage({ params, searchParams }: Page
|
|||
>
|
||||
<div className="mx-auto w-full max-w-7xl px-4 pb-12 lg:px-6">
|
||||
<DashboardBuilder
|
||||
dashboardId={params.id}
|
||||
dashboardId={id}
|
||||
editable={!tvMode}
|
||||
mode={tvMode ? "tv" : "edit"}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -2,16 +2,22 @@ import { DashboardBuilder } from "@/components/dashboards/dashboard-builder"
|
|||
import { requireStaffSession } from "@/lib/auth-server"
|
||||
|
||||
type PageProps = {
|
||||
params: { id: string }
|
||||
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={params.id} editable={false} mode="print" />
|
||||
<DashboardBuilder dashboardId={id} editable={false} mode="print" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue