Skip to content

Commit bf72941

Browse files
committed
max 5 display
1 parent 0898d57 commit bf72941

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/next/src/client/components/react-dev-overlay/ui/components/overview/segment-explorer.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ function PageSegmentTreeLayerPresentation({
8787
? staticPathsInfo.staticPaths
8888
: []
8989

90+
const resolvedStaticPaths =
91+
staticPaths.length > 5
92+
? staticPaths
93+
.slice(0, 5)
94+
.concat([
95+
`+${staticPaths.length - 5} more path${
96+
staticPaths.length - 5 === 1 ? '' : 's'
97+
}`,
98+
])
99+
: staticPaths
100+
90101
return (
91102
<div className="segment-explorer-item">
92103
{!fileName || level === 0 ? null : (
@@ -104,7 +115,7 @@ function PageSegmentTreeLayerPresentation({
104115
{pagePathPrefix === '' ? '' : `${pagePathPrefix}/`}
105116
<span className="segment-explorer-filename-path">{fileName}</span>
106117
<div>
107-
{staticPaths.map((path) => (
118+
{resolvedStaticPaths.map((path) => (
108119
<div key={path}>{path}</div>
109120
))}
110121
</div>

0 commit comments

Comments
 (0)