Files
supabase/packages/ui-patterns/CommandMenu/internal/CommandSection.tsx
Jordi Enric 6f1cfef213 clean circular deps (#34262)
* clean circular deps in telemetry

* clean circular deps in command

* fix commandmenu circular deps

* rm deps.json

* fix consent circular dep

* fix TOC circular deps

* fix wrong import path

* fix test types

* fix missing fn

* undo let change

* fix consent component

* empty
2025-03-20 11:11:11 +01:00

16 lines
352 B
TypeScript

import { ICommandSection } from './types'
const toSectionId = (str: string) => str.toLowerCase().replace(/\s+/g, '-')
const section$new = (
name: string,
{ forceMount = false, id }: { forceMount?: boolean; id?: string } = {}
): ICommandSection => ({
id: id ?? toSectionId(name),
name,
forceMount,
commands: [],
})
export { section$new }