Dev Helpers
← Back

Print signature calculator page

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

export default async function PrintSignatureCalculatorPage({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
  const { pages } = await searchParams;
  const n = Math.max(1, Math.floor(Number(pages) || 12));
  return (
    <p>
      {Math.ceil(n / 4)} folded sheets · {Math.ceil(n / 4) * 4 - n} blank pages
    </p>
  );
}