Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

428 B
Raw Blame
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 ?? '#',
      shortcutId: link.shortcutId,
    })),
  }))
}