Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ type ComponentOption = {
category: TemplateMeta["category"];
icon: undefined | string;
order: undefined | number;
firstInstance: { component: string };
};

const getComponentScore = (meta: ComponentOption) => {
Expand Down Expand Up @@ -158,6 +159,7 @@ const $componentOptions = computed(
category,
icon: meta.icon,
order: meta.order,
firstInstance: { component: name },
});
}
for (const [name, meta] of templates) {
Expand Down Expand Up @@ -188,6 +190,7 @@ const $componentOptions = computed(
category: meta.category,
icon: meta.icon ?? componentMeta?.icon,
order: meta.order,
firstInstance: meta.template.instances[0],
});
}
componentOptions.sort(
Expand All @@ -205,7 +208,7 @@ const ComponentOptionsGroup = ({ options }: { options: ComponentOption[] }) => {
heading={<CommandGroupHeading>Components</CommandGroupHeading>}
actions={["add"]}
>
{options.map(({ component, label, category, icon }) => {
{options.map(({ component, label, category, icon, firstInstance }) => {
return (
<CommandItem
key={component}
Expand All @@ -225,7 +228,7 @@ const ComponentOptionsGroup = ({ options }: { options: ComponentOption[] }) => {
>
<Flex gap={2}>
<CommandIcon>
<InstanceIcon instance={{ component }} icon={icon} />
<InstanceIcon instance={firstInstance} icon={icon} />
</CommandIcon>
<Text variant="labelsTitleCase">
{label}{" "}
Expand Down