@@ -102,6 +102,7 @@ type ComponentOption = {
102
102
category : TemplateMeta [ "category" ] ;
103
103
icon : undefined | string ;
104
104
order : undefined | number ;
105
+ firstInstance : { component : string } ;
105
106
} ;
106
107
107
108
const getComponentScore = ( meta : ComponentOption ) => {
@@ -158,6 +159,7 @@ const $componentOptions = computed(
158
159
category,
159
160
icon : meta . icon ,
160
161
order : meta . order ,
162
+ firstInstance : { component : name } ,
161
163
} ) ;
162
164
}
163
165
for ( const [ name , meta ] of templates ) {
@@ -188,6 +190,7 @@ const $componentOptions = computed(
188
190
category : meta . category ,
189
191
icon : meta . icon ?? componentMeta ?. icon ,
190
192
order : meta . order ,
193
+ firstInstance : meta . template . instances [ 0 ] ,
191
194
} ) ;
192
195
}
193
196
componentOptions . sort (
@@ -205,7 +208,7 @@ const ComponentOptionsGroup = ({ options }: { options: ComponentOption[] }) => {
205
208
heading = { < CommandGroupHeading > Components</ CommandGroupHeading > }
206
209
actions = { [ "add" ] }
207
210
>
208
- { options . map ( ( { component, label, category, icon } ) => {
211
+ { options . map ( ( { component, label, category, icon, firstInstance } ) => {
209
212
return (
210
213
< CommandItem
211
214
key = { component }
@@ -225,7 +228,7 @@ const ComponentOptionsGroup = ({ options }: { options: ComponentOption[] }) => {
225
228
>
226
229
< Flex gap = { 2 } >
227
230
< CommandIcon >
228
- < InstanceIcon instance = { { component } } icon = { icon } />
231
+ < InstanceIcon instance = { firstInstance } icon = { icon } />
229
232
</ CommandIcon >
230
233
< Text variant = "labelsTitleCase" >
231
234
{ label } { " " }
0 commit comments