Files
medusa-store/www/packages/build-scripts/src/utils/sidebar-attach-href-common-options.ts
Shahed Nasser 5deb8eaf50 docs: support multiple sidebars in a project (#11768)
* changed to new sidebar across projects except resources

* finalize multi sidebar support

* clean up

* remove redundant property

* small changes

* fixes

* generate

* fix error

* fix initial open
2025-03-07 15:47:38 +02:00

23 lines
464 B
TypeScript

import { Sidebar } from "types"
const commonOptions: Partial<Sidebar.RawSidebarItem> = {
loaded: true,
isPathHref: true,
}
export function sidebarAttachCommonOptions(
sidebar: Sidebar.RawSidebarItem[]
): Sidebar.RawSidebarItem[] {
return sidebar.map((item) => {
if (item.type === "separator") {
return item
}
return {
...commonOptions,
...item,
children: sidebarAttachCommonOptions(item.children || []),
}
})
}