CommandSection.tsx15 lines · main
1import { ICommandSection } from './types'
2
3const toSectionId = (str: string) => str.toLowerCase().replace(/\s+/g, '-')
4
5const section$new = (
6 name: string,
7 { forceMount = false, id }: { forceMount?: boolean; id?: string } = {}
8): ICommandSection => ({
9 id: id ?? toSectionId(name),
10 name,
11 forceMount,
12 commands: [],
13})
14
15export { section$new }