/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Metadata } from "next";
import config from "@payload-config";
import { NotFoundPage, generatePageMetadata } from "@payloadcms/next/views";
import { importMap } from "../importMap";

type Args = {
  params: Promise<{ [key: string]: string | string[] | undefined }>;
  searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
};

export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
  generatePageMetadata({ config, params: params as any, searchParams: searchParams as any });

const NotFound = ({ params, searchParams }: Args) =>
  NotFoundPage({ config, params: params as any, searchParams: searchParams as any, importMap });

export default NotFound;
