1- import { getAppRouterContext } from '@/app/lib/app-router-context'
2- import { AppRouterMainContextProvider } from '@/app/components/AppRouterMainContext'
3- import { translate } from '@/languages/lib/translation-utils'
4- import { CommentDiscussionIcon , MarkGithubIcon } from '@primer/octicons-react'
1+ import { Client404Wrapper } from '@/app/components/Client404Wrapper'
2+ import { createServerAppRouterContext } from '@/app/lib/server-context-utils'
3+ import { headers } from 'next/headers'
54import type { Metadata } from 'next'
65
76export const dynamic = 'force-dynamic'
@@ -12,94 +11,10 @@ export const metadata: Metadata = {
1211}
1312
1413export default async function Page404 ( ) {
15- // Get context with UI data
16- const appContext = await getAppRouterContext ( )
14+ const headersList = await headers ( )
15+ const pathname = headersList . get ( 'x-pathname' ) || '/404'
1716
18- const siteTitle = translate ( appContext . site . data . ui , 'header.github_docs' , 'GitHub Docs' )
19- const oopsTitle = translate ( appContext . site . data . ui , 'meta.oops' , 'Ooops!' )
17+ const appContext = createServerAppRouterContext ( pathname )
2018
21- return (
22- < AppRouterMainContextProvider context = { appContext } >
23- < div className = "min-h-screen d-flex flex-column" >
24- { /* Simple Header */ }
25- < div className = "border-bottom color-border-muted no-print" >
26- < header className = "container-xl p-responsive py-3 position-relative d-flex width-full" >
27- < div className = "d-flex flex-1 flex-items-center" >
28- < a
29- href = { `/${ appContext . currentLanguage } ` }
30- className = "color-fg-default no-underline d-flex flex-items-center"
31- >
32- < MarkGithubIcon size = { 32 } className = "mr-2" />
33- < span className = "f4 text-bold" > { siteTitle } </ span >
34- </ a >
35- </ div >
36- </ header >
37- </ div >
38-
39- { /* Main Content */ }
40- < div className = "container-xl p-responsive py-6 width-full flex-1" >
41- < article className = "col-md-10 col-lg-7 mx-auto" >
42- < h1 > { oopsTitle } </ h1 >
43- < div className = "f2 color-fg-muted mb-3" data-container = "lead" >
44- It looks like this page doesn't exist.
45- </ div >
46- < p className = "f3" >
47- We track these errors automatically, but if the problem persists please feel free to
48- contact us.
49- </ p >
50- < a id = "support" href = "https://support.github.com" className = "btn btn-outline mt-2" >
51- < CommentDiscussionIcon size = "small" className = "octicon mr-1" />
52- Contact support
53- </ a >
54- </ article >
55- </ div >
56-
57- < footer className = "py-6" >
58- < div className = "container-xl px-3 px-md-6" >
59- < ul className = "d-flex flex-wrap list-style-none" >
60- < li className = "d-flex mr-xl-3 color-fg-muted" >
61- < span > © 2025 GitHub, Inc.</ span >
62- </ li >
63- < li className = "ml-3" >
64- < a
65- className = "text-underline"
66- href = "/site-policy/github-terms/github-terms-of-service"
67- >
68- Terms
69- </ a >
70- </ li >
71- < li className = "ml-3" >
72- < a
73- className = "text-underline"
74- href = "/site-policy/privacy-policies/github-privacy-statement"
75- >
76- Privacy
77- </ a >
78- </ li >
79- < li className = "ml-3" >
80- < a className = "text-underline" href = "https://www.githubstatus.com/" >
81- Status
82- </ a >
83- </ li >
84- < li className = "ml-3" >
85- < a className = "text-underline" href = "https://github.com/pricing" >
86- Pricing
87- </ a >
88- </ li >
89- < li className = "ml-3" >
90- < a className = "text-underline" href = "https://services.github.com/" >
91- Expert services
92- </ a >
93- </ li >
94- < li className = "ml-3" >
95- < a className = "text-underline" href = "https://github.blog/" >
96- Blog
97- </ a >
98- </ li >
99- </ ul >
100- </ div >
101- </ footer >
102- </ div >
103- </ AppRouterMainContextProvider >
104- )
19+ return < Client404Wrapper appContext = { appContext } />
10520}
0 commit comments