From 4cf1b16a864e3dc747137ddc6da5c109f73235cb Mon Sep 17 00:00:00 2001 From: Misode Date: Thu, 31 Oct 2024 04:20:02 +0100 Subject: [PATCH] Show max 50 list items by default --- src/app/components/generator/McdocRenderer.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/components/generator/McdocRenderer.tsx b/src/app/components/generator/McdocRenderer.tsx index a777c2e4..32543c98 100644 --- a/src/app/components/generator/McdocRenderer.tsx +++ b/src/app/components/generator/McdocRenderer.tsx @@ -680,6 +680,7 @@ function ListBody({ type: outerType, node, makeEdit, ctx }: Props (node?.children?.length ?? 0) @@ -743,6 +744,16 @@ function ListBody({ type: outerType, node, makeEdit, ctx }: Props {node.children.map((item, index) => { + if (index === maxShown) { + return
+ + + +
+ } + if (index > maxShown) { + return <> + } const child = item.value const itemType = getItemType(type) const childType = simplifyType(itemType, ctx)