MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / groupLabel

Function groupLabel

app/composables/useCommandPaletteCommands.ts:43–72  ·  view source on GitHub ↗
(group: CommandPaletteGroup)

Source from the content-addressed store, hash-verified

41 }
42
43 function groupLabel(group: CommandPaletteGroup): string {
44 const packageName = packageContext.value?.packageName
45
46 switch (group) {
47 case 'actions':
48 return t('command_palette.groups.actions')
49 case 'help':
50 return t('command_palette.groups.help')
51 case 'language':
52 return t('command_palette.groups.language')
53 case 'package':
54 return packageName
55 ? t('command_palette.groups.package_with_name', { name: packageName })
56 : t('command_palette.groups.package')
57 case 'navigation':
58 return t('command_palette.groups.navigation')
59 case 'connections':
60 return t('command_palette.groups.connections')
61 case 'links':
62 return t('command_palette.groups.links')
63 case 'settings':
64 return t('nav.settings')
65 case 'npmx':
66 return t('command_palette.groups.npmx')
67 case 'versions':
68 return packageName
69 ? t('command_palette.groups.versions_with_name', { name: packageName })
70 : t('command_palette.groups.versions')
71 }
72 }
73
74 async function submitSearchQuery() {
75 const trimmedQuery = query.value.trim()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected