()
| 145 | } |
| 146 | |
| 147 | export function OptimisticMobileToc() { |
| 148 | let {currentPage} = useRouter(); |
| 149 | |
| 150 | if ((currentPage.tableOfContents?.[0]?.children?.length ?? 0) <= 1) { |
| 151 | return null; |
| 152 | } |
| 153 | |
| 154 | let withRelatedPages = currentPage.exports?.relatedPages |
| 155 | ? [ |
| 156 | ...(currentPage.tableOfContents ?? []), |
| 157 | { |
| 158 | level: 2, |
| 159 | title: 'Related pages', |
| 160 | children: [] |
| 161 | } |
| 162 | ] |
| 163 | : currentPage.tableOfContents!; |
| 164 | |
| 165 | return <MobileOnPageNav>{renderMobileToc(withRelatedPages)}</MobileOnPageNav>; |
| 166 | } |
nothing calls this directly
no test coverage detected