sistema-de-chamados/src/app/dashboards/[id]/page.tsx

35 lines
1,015 B
TypeScript

import { AppShell } from "@/components/app-shell"
import { DashboardBuilder } from "@/components/dashboards/dashboard-builder"
import { SiteHeader } from "@/components/site-header"
import { requireStaffSession } from "@/lib/auth-server"
type PageProps = {
params: { id: string }
searchParams: { [key: string]: string | string[] | undefined }
}
export const dynamic = "force-dynamic"
export default async function DashboardDetailPage({ params, searchParams }: PageProps) {
await requireStaffSession()
const tvMode = searchParams?.tv === "1"
return (
<AppShell
header={
<SiteHeader
title="Construtor de dashboards"
lead="Monte relatórios interativos com filtros globais, exportação e modo TV."
/>
}
>
<div className="mx-auto w-full max-w-7xl px-4 pb-12 lg:px-6">
<DashboardBuilder
dashboardId={params.id}
editable={!tvMode}
mode={tvMode ? "tv" : "edit"}
/>
</div>
</AppShell>
)
}