<script lang="ts" setup>
import { computed } from 'vue';

import { getDatabaseTypeIcon } from '#/assets/svg';

defineOptions({ name: 'DatabaseTypeIcon' });

const props = withDefaults(
  defineProps<{
    dbType?: string;
    size?: number;
  }>(),
  {
    dbType: '',
    size: 16,
  },
);

const iconSrc = computed(() => getDatabaseTypeIcon(props.dbType));
</script>

<template>
  <img
    :src="iconSrc"
    :width="size"
    :height="size"
    class="inline-block shrink-0 object-contain"
    alt=""
  />
</template>
