88 * - Previous/next navigation
99 */
1010
11- import { useParams , Navigate } from 'react-router-dom' ;
12- import { Edit , Calendar , AlertCircle } from 'lucide-react' ;
11+ import { Link , useParams , Navigate } from 'react-router-dom' ;
12+ import { Edit , Calendar , AlertCircle , ChevronRight } from 'lucide-react' ;
1313import { Header } from '@/components/layout/Header' ;
1414import { Footer } from '@/components/layout/Footer' ;
1515import { Sidebar , MobileSidebar } from '@/components/layout/Sidebar' ;
@@ -92,7 +92,21 @@ export function Docs() {
9292 return < Navigate to = { `/docs/${ firstProject . id } /${ latest . id } /${ firstDoc . slug } ` } replace /> ;
9393 }
9494 }
95- return < div className = "min-h-screen flex flex-col bg-docs" > < Header /> < div className = "flex-1 flex items-center justify-center" > No documentation found</ div > < Footer /> </ div > ;
95+ return (
96+ < div className = "min-h-screen flex flex-col bg-docs" >
97+ < Header />
98+ < div className = "flex-1 container mx-auto px-4 py-20 flex items-center justify-center" >
99+ < div className = "text-center max-w-md" >
100+ < p className = "text-5xl font-bold text-muted-foreground/20 mb-4" > 404</ p >
101+ < h1 className = "text-2xl font-bold mb-2" > Page not found</ h1 >
102+ < p className = "text-muted-foreground" >
103+ The page you're looking for doesn't exist or has been moved.
104+ </ p >
105+ </ div >
106+ </ div >
107+ < Footer />
108+ </ div >
109+ ) ;
96110 }
97111
98112 // Resolve the active version: use the URL segment when valid, otherwise
@@ -103,7 +117,20 @@ export function Docs() {
103117 ( version && project . versions . find ( v => v . id === version ) ) || latestVersion ;
104118
105119 if ( ! activeVersion ) {
106- return < div className = "min-h-screen flex flex-col bg-docs" > < Header /> < div className = "flex-1 flex items-center justify-center" > No documentation found for this project</ div > < Footer /> </ div > ;
120+ return (
121+ < div className = "min-h-screen flex flex-col bg-docs" >
122+ < Header />
123+ < div className = "flex-1 container mx-auto px-4 py-20 flex items-center justify-center" >
124+ < div className = "text-center max-w-md" >
125+ < h1 className = "text-2xl font-bold mb-2" > Nothing here yet</ h1 >
126+ < p className = "text-muted-foreground" >
127+ The documentation you're looking for hasn't been written yet.
128+ </ p >
129+ </ div >
130+ </ div >
131+ < Footer />
132+ </ div >
133+ ) ;
107134 }
108135
109136 if ( ! version || version !== activeVersion . id ) {
@@ -112,7 +139,20 @@ export function Docs() {
112139 if ( targetSlug ) {
113140 return < Navigate to = { `/docs/${ project . id } /${ activeVersion . id } /${ targetSlug } ` } replace /> ;
114141 }
115- return < div className = "min-h-screen flex flex-col bg-docs" > < Header /> < div className = "flex-1 flex items-center justify-center" > No documentation found for this project</ div > < Footer /> </ div > ;
142+ return (
143+ < div className = "min-h-screen flex flex-col bg-docs" >
144+ < Header />
145+ < div className = "flex-1 container mx-auto px-4 py-20 flex items-center justify-center" >
146+ < div className = "text-center max-w-md" >
147+ < h1 className = "text-2xl font-bold mb-2" > Nothing here yet</ h1 >
148+ < p className = "text-muted-foreground" >
149+ The documentation you're looking for hasn't been written yet.
150+ </ p >
151+ </ div >
152+ </ div >
153+ < Footer />
154+ </ div >
155+ ) ;
116156 }
117157
118158 // Redirect to first doc in version if no slug provided.
@@ -121,7 +161,20 @@ export function Docs() {
121161 if ( firstDoc ) {
122162 return < Navigate to = { `/docs/${ project . id } /${ activeVersion . id } /${ firstDoc . slug } ` } replace /> ;
123163 }
124- return < div className = "min-h-screen flex flex-col bg-docs" > < Header /> < div className = "flex-1 flex items-center justify-center" > No documentation found for this project</ div > < Footer /> </ div > ;
164+ return (
165+ < div className = "min-h-screen flex flex-col bg-docs" >
166+ < Header />
167+ < div className = "flex-1 container mx-auto px-4 py-20 flex items-center justify-center" >
168+ < div className = "text-center max-w-md" >
169+ < h1 className = "text-2xl font-bold mb-2" > Nothing here yet</ h1 >
170+ < p className = "text-muted-foreground" >
171+ The documentation you're looking for hasn't been written yet.
172+ </ p >
173+ </ div >
174+ </ div >
175+ < Footer />
176+ </ div >
177+ ) ;
125178 }
126179
127180 // Get prev/next navigation within the active version.
@@ -201,9 +254,38 @@ export function Docs() {
201254 < div className = "h-4 bg-muted rounded w-5/6 animate-pulse" />
202255 </ div >
203256 ) : ! doc ? (
204- < div className = "py-20 text-center" >
205- < p className = "text-4xl font-bold mb-4" > 404</ p >
206- < p className = "text-muted-foreground" > This page doesn't exist.</ p >
257+ < div className = "py-16" >
258+ < div className = "text-center mb-10" >
259+ < p className = "text-6xl font-bold text-muted-foreground/20 mb-4" > 404</ p >
260+ < h2 className = "text-2xl font-bold mb-2" > Page not found</ h2 >
261+ < p className = "text-muted-foreground max-w-md mx-auto" >
262+ This documentation page doesn't exist. Try searching with < kbd className = "px-1.5 py-0.5 rounded border bg-muted font-mono text-xs" > ←⌥K</ kbd > or browse the sections below.
263+ </ p >
264+ </ div >
265+ < div className = "max-w-lg mx-auto" >
266+ < p className = "text-sm font-medium text-muted-foreground mb-4 text-center" >
267+ Browse { project . name } documentation
268+ </ p >
269+ < div className = "space-y-2" >
270+ { activeVersion . categories . map ( cat => {
271+ const firstDoc = cat . docs [ 0 ] ;
272+ if ( ! firstDoc ) return null ;
273+ return (
274+ < Link
275+ key = { cat . name }
276+ to = { `/docs/${ project . id } /${ activeVersion . id } /${ firstDoc . slug } ` }
277+ className = "flex items-center gap-3 p-3 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-all group"
278+ >
279+ < div className = "flex-1 min-w-0" >
280+ < p className = "font-medium text-sm group-hover:text-primary transition-colors" > { cat . name } </ p >
281+ < p className = "text-xs text-muted-foreground" > { cat . docs . length } { cat . docs . length === 1 ? 'doc' : 'docs' } </ p >
282+ </ div >
283+ < ChevronRight className = "h-4 w-4 text-muted-foreground/50 group-hover:text-primary transition-colors shrink-0" />
284+ </ Link >
285+ ) ;
286+ } ) }
287+ </ div >
288+ </ div >
207289 </ div >
208290 ) : (
209291 < div key = { slug } className = "animate-fadein mx-auto max-w-4xl" >
0 commit comments