Dev Helpers
← Back

Proof approval return link

Place this file at app/print/page.tsx in an App Router project.

Open this example in the interactive library

Source code

// app/print/page.tsx

import Link from "next/link";

export default async function ProofApprovalReturnLink({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
  const { order } = await searchParams;
  return typeof order === "string" && /^\d+$/.test(order) ? (
    <Link href={"/orders/" + order + "/proof"}>Review order {order} proof</Link>
  ) : (
    <p>Choose a numeric order ID.</p>
  );
}