import Separator from 'flarum/components/Separator'; import classList from 'flarum/utils/classList'; function isSeparator(item) { return item && item.component === Separator; } function withoutUnnecessarySeparators(items) { const newItems = []; let prevItem; items.forEach((item, i) => { if (!isSeparator(item) || (prevItem && !isSeparator(prevItem) && i !== items.length - 1)) { prevItem = item; newItems.push(item); } }); return newItems; } /** * The `listItems` helper wraps a collection of components in