<script setup lang="ts">
import { useFileInfoStore } from '@/stores/file-info-data'

const { mimeFileMapping } = useFileInfoStore()

defineProps<{ fileMimeType: any; size: string }>()

function getIcon(mimeType: string) {
  if (mimeFileMapping.hasOwnProperty(mimeType)) {
    return mimeFileMapping[mimeType].icon
  } else {
    return 'mdi-file-question-outline'
  }
}
function getColor(mimeType: string) {
  if (mimeFileMapping.hasOwnProperty(mimeType)) {
    return mimeFileMapping[mimeType].color
  } else {
    return 'blue-11'
  }
}
function getSize(s: string) {
  if (s === 'preview') {
    return '6em'
  }
}
</script>

<template>
  <q-icon
    :name="getIcon(fileMimeType)"
    :color="getColor(fileMimeType)"
    :size="getSize(size)"
  />
</template>
