Dev Helpers
← Back

Balanced edition checklist

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

Open this example in the interactive library

Source code

// app/editorial/page.tsx

export default async function BalancedEditionChecklist({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
  const posts = [
    { title: "Paper mills", day: "2028-04-01", desk: "News", words: 840 },
    { title: "At the kiln", day: "2028-04-03", desk: "Art", words: 1500 },
    { title: "City briefs", day: "2028-04-03", desk: "News", words: 540 },
  ];
  const { day } = await searchParams;
  const selected = posts.filter((p) => p.day === day);
  return (
    <ul>
      {["News", "Art"].map((d) => (
        <li key={d}>
          {d}: {selected.some((p) => p.desk === d) ? "Covered" : "Needs a story"}
        </li>
      ))}
    </ul>
  );
}