Exclude "add-comment" and "bulk-entries" from overview entry count (#15718)

GitOrigin-RevId: 0aae510a36aa717b601795eb51d8c97f9309ada2
This commit is contained in:
Alf Eaton 2023-11-17 12:25:04 +00:00 committed by Copybot
parent 11ce29197b
commit bf6257af80

View file

@ -39,7 +39,11 @@ function OverviewFile({ docId, docPath }: OverviewFileProps) {
return orderedEntries
}, [docEntries])
const entryCount = Object.keys(docEntries).length
const entryCount = useMemo(() => {
return Object.keys(docEntries).filter(
key => key !== 'add-comment' && key !== 'bulk-actions'
).length
}, [docEntries])
const handleToggleCollapsed = () => {
setCollapsed({ ...collapsed, [docId]: !docCollapsed })