diff --git a/src/components/PrevNextLinks.tsx b/src/components/PrevNextLinks.tsx index 7f3c52cf..d8fa9551 100644 --- a/src/components/PrevNextLinks.tsx +++ b/src/components/PrevNextLinks.tsx @@ -50,13 +50,9 @@ function PageLink({ ); } function collect(array: Array, result: Array): void { - array.forEach((el) => { - if (el.items) { - collect(el.items, result); - } else { - result.push(el); - } - }); + array.forEach((value) => + value.items ? collect(value.items, result) : result.push(value), + ); } export function PrevNextLinks() {