diff --git a/app/staff/report/page.tsx b/app/staff/report/page.tsx new file mode 100644 index 0000000..88d6af9 --- /dev/null +++ b/app/staff/report/page.tsx @@ -0,0 +1,82 @@ +import { Suspense } from "react"; +import { StaffReportView } from "@/components/StaffReportView"; +import { SiteHeader, SiteFooter } from "@/components/SiteChrome"; +import { isStaffKeyValid } from "@/lib/staff-auth"; + +interface PageProps { + searchParams: Promise<{ org?: string; key?: string }>; +} + +export const metadata = { + title: "Staff report — Food Co-op Initiative", + robots: { index: false, follow: false }, +}; + +export default async function StaffReportPage({ searchParams }: PageProps) { + const { org, key } = await searchParams; + + // Generic "not found" if the key is missing or wrong — don't confirm + // route existence. + if (!isStaffKeyValid(key)) { + return ; + } + + const orgId = Number(org); + const orgValid = !!org && Number.isFinite(orgId) && orgId > 0; + + return ( + <> + + Skip to content + + +
+
+ {orgValid ? ( + + + + ) : ( + + )} +
+
+ + + ); +} + +function NotFound() { + return ( + <> + +
+
+

Not found

+

+ The page you requested doesn't exist. +

+
+
+ + + ); +} + +function MissingOrg() { + return ( +
+

+ Missing or invalid org id. +

+

+ Add ?org=<civi-org-id> to the URL. The org + id is the Civi Contact id of the organization (visible in the URL when + viewing the org in CiviCRM). +

+
+ ); +}