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>
);
}
