chore: remove WithLayout from not-found.tsx (#19331)

This commit is contained in:
Benny Joo authored and GitHub committed 2025-02-18 11:07:16 +00:00
1 parent d2c4c45137
commit 599744b31c
1 file changed
+17 -9
+17 -9
View File
@@ -1,5 +1,5 @@
import { _generateMetadata, getTranslate } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
import { headers } from "next/headers";
import Link from "next/link";
@@ -10,6 +10,8 @@ import {
import { DOCS_URL, IS_CALCOM, WEBSITE_URL } from "@calcom/lib/constants";
import { Icon } from "@calcom/ui";
import PageWrapper from "@components/PageWrapperAppDir";
enum PageType {
ORG = "ORG",
TEAM = "TEAM",
@@ -46,11 +48,9 @@ function getPageInfo(pathname: string, host: string) {
}
}
async function NotFound() {
const t = await getTranslate();
const headersList = headers();
const host = headersList.get("x-forwarded-host") ?? "";
const pathname = headersList.get("x-pathname") ?? "";
function NotFound({ t, headers }: { t: any; headers: ReadonlyHeaders }) {
const host = headers.get("x-forwarded-host") ?? "";
const pathname = headers.get("x-pathname") ?? "";
// This makes more sense after full migration to App Router
// if (!pathname) {
@@ -241,6 +241,14 @@ export const generateMetadata = async () => {
};
};
export default WithLayout({
ServerPage: NotFound,
});
const ServerPage = async () => {
const t = await getTranslate();
const h = headers();
const nonce = h.get("x-nonce") ?? undefined;
return (
<PageWrapper requiresLicense={false} nonce={nonce} themeBasis={null}>
<NotFound t={t} headers={h} />
</PageWrapper>
);
};
export default ServerPage;