11<script setup lang="ts">
22import type { DataSourceMeta } from ' ../../engine'
3+ import DisplayIconifyRemoteIcon from ' @antfu/design/components/Display/DisplayIconifyRemoteIcon.vue'
34import { SelectContent , SelectIcon , SelectItem , SelectItemIndicator , SelectPortal , SelectRoot , SelectTrigger , SelectViewport } from ' reka-ui'
45import { computed } from ' vue'
56
@@ -26,8 +27,9 @@ function iconOf(source: DataSourceMeta | undefined): string {
2627 class="text-sm px-2.5 outline-none border border-base rounded bg-base inline-flex gap-2 h-9 min-w-52 max-w-80 transition items-center justify-between data-[disabled]:op50 focus-visible:ring-2 focus-visible:ring-primary-500 /40"
2728 >
2829 <span class =" inline-flex items-center gap-2 min-w-0" >
29- <!-- TODO: migrate to IconifyIcon.vue in @antfu/design 0.3 -->
30- <span class =" shrink-0 color-active" :class =" iconOf(active)" aria-hidden =" true" />
30+ <!-- Source icons are declared per-source at runtime, so render them via
31+ the remote-icon component rather than a static (build-extracted) class. -->
32+ <DisplayIconifyRemoteIcon :icon =" iconOf (active )" class="shrink-0 w-3.5 h-3.5 color-active [&_svg]:h-full [&_svg]:w-full " aria-hidden="true" />
3133 <span class =" truncate font-semibold text-primary" >{{ active?.title ?? placeholder ?? 'Data source' }}</span >
3234 </span >
3335 <SelectIcon class="op-fade shrink-0">
@@ -47,8 +49,7 @@ function iconOf(source: DataSourceMeta | undefined): string {
4749 :value =" source .id "
4850 class="text-sm color-base py-1.5 pl-2 pr-2 outline-none rounded-md flex gap-2 cursor-pointer select-none transition items-start relative data-[highlighted]:bg-active "
4951 >
50- <!-- TODO: migrate to IconifyIcon.vue in @antfu/design 0.3 -->
51- <span class =" shrink-0 mt-0.5 color-active" :class =" iconOf(source)" aria-hidden =" true" />
52+ <DisplayIconifyRemoteIcon :icon =" iconOf (source )" class="shrink-0 mt-0.5 w-3.5 h-3.5 color-active [&_svg]:h-full [&_svg]:w-full " aria-hidden="true" />
5253 <span class =" flex flex-col min-w-0 flex-1" >
5354 <span class =" flex items-center gap-1.5" >
5455 <span class =" truncate font-medium" >{{ source.title }}</span >
0 commit comments