Skip to content

Commit 044c3e1

Browse files
author
Lasim
committed
feat(frontend): implement McpInstallationsEmptyState component
1 parent 05d5a35 commit 044c3e1

File tree

2 files changed

+53
-38
lines changed

2 files changed

+53
-38
lines changed

services/frontend/src/components/mcp-server/McpInstallationsCard.vue

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
<script setup lang="ts">
2-
import { useI18n } from 'vue-i18n'
3-
import {
4-
Plus,
5-
PackagePlus
6-
} from 'lucide-vue-next'
72
import type { McpInstallation } from '@/types/mcp-installations'
83
import McpInstallationsList from './McpInstallationsList.vue'
9-
import FeaturedMcpServers from './FeaturedMcpServers.vue'
4+
import McpInstallationsEmptyState from './McpInstallationsEmptyState.vue'
105
116
interface Props {
127
installations: McpInstallation[]
@@ -23,8 +18,6 @@ const emit = defineEmits<{
2318
removeInstallation: [installationId: string]
2419
}>()
2520
26-
const { t } = useI18n()
27-
2821
const handleInstallServer = () => {
2922
emit('installServer')
3023
}
@@ -44,36 +37,10 @@ const handleRemoveInstallation = (installationId: string) => {
4437

4538
<template>
4639
<!-- Empty State -->
47-
<div v-if="!hasInstallations" class="space-y-8">
48-
<div class="pt-20">
49-
<button
50-
type="button"
51-
@click="handleInstallServer"
52-
class="relative block w-full max-w-2xl mx-auto rounded-lg border-2 border-dashed border-muted-foreground/25 p-12 text-center hover:border-muted-foreground/40 hover:bg-muted/20 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden transition-all duration-200 group"
53-
>
54-
<div class="mx-auto size-16 text-muted-foreground/60 group-hover:text-muted-foreground/80 transition-colors duration-200">
55-
<PackagePlus class="w-full h-full" stroke-width="1.25" />
56-
</div>
57-
<div class="mt-4 space-y-2">
58-
<span class="block text-sm font-semibold text-foreground group-hover:text-foreground/90 transition-colors duration-200">
59-
{{ t('mcpInstallations.emptyState.title') }}
60-
</span>
61-
<span class="block text-sm text-muted-foreground group-hover:text-muted-foreground/80 transition-colors duration-200">
62-
{{ t('mcpInstallations.emptyState.description') }}
63-
</span>
64-
<div class="mt-4 inline-flex items-center gap-1.5 text-xs text-primary font-medium group-hover:text-primary/80 transition-colors duration-200">
65-
<Plus class="h-3.5 w-3.5" />
66-
{{ t('mcpInstallations.actions.install') }}
67-
</div>
68-
</div>
69-
</button>
70-
</div>
71-
72-
<!-- Featured MCP Servers -->
73-
<div class="mt-20 max-w-7xl">
74-
<FeaturedMcpServers />
75-
</div>
76-
</div>
40+
<McpInstallationsEmptyState
41+
v-if="!hasInstallations"
42+
@install-server="handleInstallServer"
43+
/>
7744

7845
<!-- Installations List -->
7946
<div v-else>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<script setup lang="ts">
2+
import { useI18n } from 'vue-i18n'
3+
import { Plus, PackagePlus } from 'lucide-vue-next'
4+
import FeaturedMcpServers from './FeaturedMcpServers.vue'
5+
6+
const emit = defineEmits<{
7+
installServer: []
8+
}>()
9+
10+
const { t } = useI18n()
11+
12+
const handleInstallServer = () => {
13+
emit('installServer')
14+
}
15+
</script>
16+
17+
<template>
18+
<div class="space-y-8">
19+
<div class="pt-20">
20+
<button
21+
type="button"
22+
@click="handleInstallServer"
23+
class="relative block w-full max-w-2xl mx-auto rounded-lg border-2 border-dashed border-muted-foreground/25 p-12 text-center hover:border-muted-foreground/40 hover:bg-muted/20 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden transition-all duration-200 group"
24+
>
25+
<div class="mx-auto size-16 text-muted-foreground/60 group-hover:text-muted-foreground/80 transition-colors duration-200">
26+
<PackagePlus class="w-full h-full" stroke-width="1.25" />
27+
</div>
28+
<div class="mt-4 space-y-2">
29+
<span class="block text-sm font-semibold text-foreground group-hover:text-foreground/90 transition-colors duration-200">
30+
{{ t('mcpInstallations.emptyState.title') }}
31+
</span>
32+
<span class="block text-sm text-muted-foreground group-hover:text-muted-foreground/80 transition-colors duration-200">
33+
{{ t('mcpInstallations.emptyState.description') }}
34+
</span>
35+
<div class="mt-4 inline-flex items-center gap-1.5 text-xs text-primary font-medium group-hover:text-primary/80 transition-colors duration-200">
36+
<Plus class="h-3.5 w-3.5" />
37+
{{ t('mcpInstallations.actions.install') }}
38+
</div>
39+
</div>
40+
</button>
41+
</div>
42+
43+
<!-- Featured MCP Servers -->
44+
<div class="mt-20 max-w-7xl">
45+
<FeaturedMcpServers />
46+
</div>
47+
</div>
48+
</template>

0 commit comments

Comments
 (0)