main
vue 52 lines 1.48 KB
Raw
1 <template>
2 <CardEntity hoverable clickable size="small" :class="{ highlighted: selected }" @click="$emit('select')">
3 <template #headerMain>
4 <div class="flex items-center gap-2">
5 <div class="flex h-full items-center justify-center" :style="{ color: category.color }">
6 <Icon :name="getDashboardIcon(category.icon)" :size="16" />
7 </div>
8 {{ category.title }}
9 </div>
10 </template>
11 <template #default>
12 <div class="flex flex-col gap-2">
13 <p class="text-xs">
14 {{ category.description }}
15 </p>
16 <div v-if="category.tags.length" class="text-tertiary flex flex-wrap gap-2 text-xs">
17 <span v-for="tag in category.tags" :key="tag">#{{ tag }}</span>
18 </div>
19 </div>
20 </template>
21
22 <template #footerMain>
23 <div class="flex flex-wrap gap-2">
24 <Badge type="splitted">
25 <template #label>Vendor</template>
26 <template #value>{{ category.vendor }}</template>
27 </Badge>
28 <Badge type="splitted">
29 <template #label>Type</template>
30 <template #value>{{ category.event_type }}</template>
31 </Badge>
32 </div>
33 </template>
34 </CardEntity>
35 </template>
36
37 <script setup lang="ts">
38 import type { DashboardCategory } from "@/types/dashboards.d"
39 import Badge from "@/components/common/Badge.vue"
40 import CardEntity from "@/components/common/cards/CardEntity.vue"
41 import Icon from "@/components/common/Icon.vue"
42 import { getDashboardIcon } from "./utils"
43
44 defineProps<{
45 category: DashboardCategory
46 selected?: boolean
47 }>()
48
49 defineEmits<{
50 select: []
51 }>()
52 </script>