mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
44 lines
692 B
Vue
44 lines
692 B
Vue
<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 {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.flag-icon img {
|
|
vertical-align: middle;
|
|
}
|
|
</style>
|