refactor: added language flag component

This commit is contained in:
2026-01-14 20:29:02 +01:00
parent 1819569234
commit e3e5eb3460
7 changed files with 60 additions and 38 deletions
+37
View File
@@ -0,0 +1,37 @@
<template>
<div class="flag-icon">
<img
:src="languageFlagSrc"
alt="language flag"
:style="{
width: width
}"
/>
</div>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { getLanguageNameById } from '../../utils/languageUtils';
const props = defineProps({
languageId: {
type: Number,
required: true
},
width: {
type: String
}
});
const languageFlagSrc = computed(
() => `/images/flags/${getLanguageNameById(props.languageId)}.svg`
);
</script>
<style scoped>
.flag-icon img {
vertical-align: middle;
}
</style>