main
vue 38 lines 881 Bytes
Raw
1 <template>
2 <Icon v-if="technology" :name="getTechnologyIcon(technology)" :size />
3 </template>
4
5 <script setup lang="ts">
6 import Icon from "@/components/common/Icon.vue"
7 import { iconFromOs } from "@/utils"
8
9 const { technology, size = 14 } = defineProps<{
10 technology?: string
11 size?: number
12 }>()
13
14 function getTechnologyIcon(tech?: string): string {
15 if (!tech) return "carbon:application"
16
17 const techLower = tech.toLowerCase()
18
19 if (techLower.includes("win") || techLower.includes("lin") || techLower.includes("mac")) {
20 return iconFromOs(tech)
21 }
22
23 if (techLower.includes("wazuh")) {
24 return "carbon:security"
25 }
26 if (techLower.includes("velociraptor")) {
27 return "fluent-emoji-high-contrast:eagle"
28 }
29 if (techLower.includes("network")) {
30 return "carbon:network-3"
31 }
32 if (techLower.includes("cloud")) {
33 return "carbon:cloud"
34 }
35
36 return "carbon:application"
37 }
38 </script>