mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 09:50:33 -04:00
23c827bdda
- consolidate `top level menu` and `contextual menu` into nested menu on mobile - remove legacy mobile submenu
14 lines
393 B
TypeScript
14 lines
393 B
TypeScript
import type { ProductMenuGroup, SubMenuSection } from './ProductMenu.types'
|
|
|
|
export function convertSectionsToProductMenu(sections: SubMenuSection[]): ProductMenuGroup[] {
|
|
return sections.map((section) => ({
|
|
key: section.key,
|
|
title: section.heading,
|
|
items: section.links.map((link) => ({
|
|
key: link.key,
|
|
name: link.label,
|
|
url: link.href ?? '#',
|
|
})),
|
|
}))
|
|
}
|