Files
veridian/app/components/ModelIcon.vue
T

24 lines
878 B
Vue

<script setup lang="ts">
import { getModelConfig } from '~/utils/model-mapping';
const props = defineProps<{
modelId: string;
variant?: 'monochrome' | 'color';
size?: string | number;
avatar?: boolean;
}>();
const config = computed(() => getModelConfig(props.modelId));
</script>
<template>
<div class="inline-flex items-center justify-center" v-bind="$attrs">
<component v-if="config.Icon" :is="config.Icon" :avatar="avatar" :size="size" :color="variant === 'color'"
v-bind="config.props" />
<!-- Fallback if no logo matches -->
<div v-else :style="{ width: `${props.size}px`, height: `${props.size}px` }"
class="bg-[var(--color-highlight)] rounded-md flex items-center justify-center">
<Icon name="tabler:brain" class="text-5 text-[var(--color-muted)]" />
</div>
</div>
</template>