export default async function PerItemPage()

in appdev_genai_googlecloud/src/knowledge-drive-firestore/src/app/(pages)/items/[slug]/page.tsx [6:30]


export default async function PerItemPage({
  params,
}: {
  params: { slug: string };
}) {
  const action = "showItemDetails";
  const headersList = headers();
  const owner = await getOwner(headersList);
  const sourceIP = await getSourceIP(headersList);
  const { slug: id } = params;

  const res = await getDownloadURL(id);

  if (!res.url) {
    logWarn({
      owner: owner,
      sourceIP: sourceIP,
      action: action,
      message: `${sourceIP}/${owner}/${action}/${id}: Failed to find item with id ${id}`,
    });
    return notFound();
  }

  redirect(res.url);
}