@@ -112,13 +112,15 @@ function ErrorPage({
112112 ) : null }
113113 < HeroSection { ...resolvedHeroProps } />
114114
115- { possibleMatches ? (
115+ { possibleMatches ?. length ? (
116116 < PossibleMatchesSection
117117 matches = { possibleMatches }
118118 query = { possibleMatchesQuery }
119119 />
120120 ) : null }
121121
122+ { possibleMatches ?. length === 0 ? < Spacer size = "lg" /> : null }
123+
122124 { articles ?. length ? (
123125 < >
124126 < div id = "articles" />
@@ -142,9 +144,7 @@ function PossibleMatchesSection({
142144 query ?: string
143145} ) {
144146 const q = typeof query === 'string' ? query . trim ( ) : ''
145- const searchUrl = q ? `/search?q=${ encodeURIComponent ( q ) } ` : '/search'
146147 const sorted = sortNotFoundMatches ( matches )
147- const hasMatches = sorted . length > 0
148148
149149 return (
150150 < >
@@ -195,13 +195,6 @@ function PossibleMatchesSection({
195195 </ li >
196196 ) ) }
197197 </ ul >
198- < p className = "mt-4 text-sm text-slate-500" >
199- { hasMatches ? 'None of these match? ' : 'No close matches found. ' }
200- < a href = { searchUrl } className = "underlined" >
201- Try semantic search
202- </ a >
203- .
204- </ p >
205198 </ div >
206199 </ Grid >
207200 </ >
@@ -233,10 +226,20 @@ function FourOhFour({
233226 const searchUrl = q ? `/search?q=${ encodeURIComponent ( q ) } ` : '/search'
234227 const hasPossibleMatches =
235228 Array . isArray ( possibleMatchesProp ) && possibleMatchesProp . length > 0
236- const heroActionTo = hasPossibleMatches ? '#possible-matches' : searchUrl
237- const heroActionLabel = hasPossibleMatches
238- ? 'Possible matches'
239- : 'Search the site'
229+ const heroAction = hasPossibleMatches ? (
230+ < ArrowLink to = "#possible-matches" className = "whitespace-nowrap" >
231+ Possible matches
232+ </ ArrowLink >
233+ ) : (
234+ < div className = "space-y-2" >
235+ < ArrowLink to = { searchUrl } className = "whitespace-nowrap" >
236+ Search the site
237+ </ ArrowLink >
238+ < p className = "text-sm text-slate-500 dark:text-slate-400" >
239+ Uses semantic search to find related content.
240+ </ p >
241+ </ div >
242+ )
240243
241244 // Most pages intentionally use the global `mx-10vw` gutter (it’s part of the
242245 // overall site layout). The 404 view reads better on mobile when it’s a bit
@@ -255,11 +258,7 @@ function FourOhFour({
255258 title : "404 - Oh no, you found a page that's missing stuff." ,
256259 subtitle : `"${ pathname } " is not a page on kentcdodds.com. So sorry.` ,
257260 image : < MissingSomething className = "rounded-lg" aspectRatio = "3:4" /> ,
258- action : (
259- < ArrowLink to = { heroActionTo } className = "whitespace-nowrap" >
260- { heroActionLabel }
261- </ ArrowLink >
262- ) ,
261+ action : heroAction ,
263262 } }
264263 />
265264 </ div >
0 commit comments