feat: Flag icon component (#10564)

This commit is contained in:
Sivin Varghese
2024-12-10 11:53:24 +05:30
committed by GitHub
parent aebcbb63e4
commit 1b0e94ec95
7 changed files with 153 additions and 14 deletions

View File

@@ -0,0 +1,24 @@
<script setup>
import { h, defineProps } from 'vue';
const props = defineProps({
country: { type: String, required: true },
squared: { type: Boolean, default: false },
});
const renderFlag = () => {
const classes = ['fi', `fi-${props.country.toLowerCase()}`, 'flex-shrink-0'];
if (props.squared) {
classes.push('fis');
}
return h('span', { class: classes });
};
</script>
<template>
<component :is="renderFlag" />
</template>
<style>
@import 'flag-icons/css/flag-icons.min.css';
</style>