@@ -59,24 +59,66 @@ const groupedIntegrations = computed(() => {
5959 ) as Record <string , Integration []>
6060})
6161
62+ const categoryLabelMap: Record <string , string > = {
63+ chat: ' Chat Providers' ,
64+ chatproviders: ' Chat Providers' ,
65+ aimodel: ' AI Models' ,
66+ aimodels: ' AI Models' ,
67+ productivity: ' Productivity' ,
68+ musicaudio: ' Music & Audio' ,
69+ smarthome: ' Smart Home' ,
70+ toolsautomation: ' Tools & Automation' ,
71+ mediacreative: ' Media & Creative' ,
72+ social: ' Social' ,
73+ platform: ' Platforms' ,
74+ platforms: ' Platforms' ,
75+ }
76+
77+ function normalizeCategoryKey(category : string ): string {
78+ return category .replace (/ [^ a-z0-9 ] / gi , ' ' ).toLowerCase ()
79+ }
80+
81+ function formatCategoryLabel(category : string ): string {
82+ const mappedLabel = categoryLabelMap [normalizeCategoryKey (category )]
83+ if (mappedLabel ) {
84+ return mappedLabel
85+ }
86+
87+ const spaced = category
88+ .replace (/ [_-] + / g , ' ' )
89+ .replace (/ ([a-z0-9 ] )([A-Z ] )/ g , ' $1 $2' )
90+ .replace (/ ([A-Z ] + )([A-Z ][a-z ] )/ g , ' $1 $2' )
91+ .trim ()
92+ .replace (/ \s + / g , ' ' )
93+
94+ return spaced || category
95+ }
96+
97+ function normalizeEntries(entries : Integration []): Integration [] {
98+ return entries .map (item => ({
99+ ... item ,
100+ category: formatCategoryLabel (item .category ),
101+ }))
102+ }
103+
62104function normalizeResponse(response : Integration [] | { integrations? : Integration [] }): Integration [] {
63105 if (Array .isArray (response )) {
64- return response
106+ return normalizeEntries ( response )
65107 }
66108 if (response && Array .isArray (response .integrations )) {
67- return response .integrations
109+ return normalizeEntries ( response .integrations )
68110 }
69111 return []
70112}
71113
72114function statusIcon(status : Integration [' status' ]): string {
73115 if (status === ' Active' ) {
74- return ' hugeicons:checkmark-circle -02'
116+ return ' hugeicons:tick -02'
75117 }
76118 if (status === ' Available' ) {
77- return ' hugeicons:add-circle '
119+ return ' hugeicons:add-01 '
78120 }
79- return ' hugeicons:timer -01'
121+ return ' hugeicons:clock -01'
80122}
81123
82124function statusClass(status : Integration [' status' ]): string {
@@ -276,7 +318,7 @@ onMounted(() => {
276318 class =" inline-flex items-center gap-1.5 text-[11px] font-medium"
277319 :class =" statusClass(integration.status)"
278320 >
279- <Icon :icon =" statusIcon (integration .status )" class="size-3.5 " />
321+ <Icon :icon =" statusIcon (integration .status )" class="size-3.5 shrink-0 " />
280322 {{ statusLabel(integration.status) }}
281323 </span >
282324 <span class =" text-[11px] text-muted-foreground truncate" :title =" integration.category" >
0 commit comments