File tree Expand file tree Collapse file tree
frontend/src/components/docs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,6 +162,15 @@ const docsPages: DocPage[] = [
162162 } ,
163163]
164164
165+ // Pre-compute grouped pages at module level since docsPages is constant
166+ const groupedPages = docsPages . reduce ( ( acc , page ) => {
167+ if ( ! acc [ page . category ] ) {
168+ acc [ page . category ] = [ ]
169+ }
170+ acc [ page . category ] . push ( page )
171+ return acc
172+ } , { } as Record < string , DocPage [ ] > )
173+
165174export function DocsSearch ( ) {
166175 const [ open , setOpen ] = useState ( false )
167176 const navigate = useNavigate ( )
@@ -183,15 +192,6 @@ export function DocsSearch() {
183192 command ( )
184193 } , [ ] )
185194
186- // Group pages by category
187- const groupedPages = docsPages . reduce ( ( acc , page ) => {
188- if ( ! acc [ page . category ] ) {
189- acc [ page . category ] = [ ]
190- }
191- acc [ page . category ] . push ( page )
192- return acc
193- } , { } as Record < string , DocPage [ ] > )
194-
195195 return (
196196 < >
197197 < button
You can’t perform that action at this time.
0 commit comments