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; // CIVI_BASE_URL flows from server config to client only as a base for // outbound file links. No secret material is exposed. const civiBaseUrl = process.env.CIVI_BASE_URL ?? ""; 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).

); }