hermes/frontend/src/components/ToolIcon.vue
Nico ccee249618 v0.6.42: Hermes chat UI — Vue3/TS/Vite, audio STT/TTS, sidebar rail, MCP event loop
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 19:35:10 +02:00

45 lines
1.0 KiB
Vue

<template>
<component :is="icon" class="tool-icon w-3.5 h-3.5 inline shrink-0" />
</template>
<script setup lang="ts">
import { computed } from 'vue';
import {
BookOpenIcon,
PencilIcon,
WrenchIcon,
DocumentPlusIcon,
BoltIcon,
GlobeAltIcon,
CpuChipIcon,
ComputerDesktopIcon,
ChatBubbleLeftIcon,
LinkIcon,
Cog6ToothIcon,
} from '@heroicons/vue/20/solid';
const props = defineProps<{ tool: string }>();
const iconMap: Record<string, any> = {
read: BookOpenIcon,
write: PencilIcon,
edit: WrenchIcon,
append: DocumentPlusIcon,
exec: BoltIcon,
web_search: GlobeAltIcon,
web_fetch: GlobeAltIcon,
memory_search: CpuChipIcon,
memory_get: CpuChipIcon,
browser: ComputerDesktopIcon,
};
const icon = computed(() => {
if (!props.tool) return BoltIcon;
const t = props.tool.toLowerCase();
if (iconMap[t]) return iconMap[t];
if (t.includes('message')) return ChatBubbleLeftIcon;
if (t.includes('session')) return LinkIcon;
return Cog6ToothIcon;
});
</script>