diff --git a/next/src/components/SidebarNodes.astro b/next/src/components/SidebarNodes.astro index 3ac471d0490dd..230d74616fe61 100644 --- a/next/src/components/SidebarNodes.astro +++ b/next/src/components/SidebarNodes.astro @@ -17,15 +17,22 @@ const { nodes, active, titleById, urlById } = Astro.props; /** Keep anything that links somewhere or that still has renderable children. */ const renderable = (n: SidebarNode): boolean => Boolean(n.id) || (Array.isArray(n.items) && n.items.some(renderable)); + +const hasChildren = (n: SidebarNode): boolean => + Array.isArray(n.items) && n.items.some(renderable); ---