This commit is contained in:
Sacha Weatherstone
2023-02-12 16:08:09 +10:00
parent 42273c5ac8
commit 008bc96252
9 changed files with 39 additions and 29 deletions
+7 -6
View File
@@ -361,10 +361,10 @@ export const CommandPalette = (): JSX.Element => {
<CommandInput placeholder="Type a command or search..." />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
{groups.map((group) => (
<CommandGroup heading={group.label}>
{group.commands.map((command) => (
<>
{groups.map((group, index) => (
<CommandGroup key={index} heading={group.label}>
{group.commands.map((command, index) => (
<div key={index}>
<CommandItem
onSelect={() => {
command.action && command.action();
@@ -375,14 +375,15 @@ export const CommandPalette = (): JSX.Element => {
{command.label}
</CommandItem>
{command.subItems &&
command.subItems.map((subItem) => (
command.subItems.map((subItem, index) => (
<SubItem
key={index}
label={subItem.label}
icon={subItem.icon}
action={subItem.action}
/>
))}
</>
</div>
))}
</CommandGroup>
))}