jws-frontend/src/components/BadgeComponent.vue

26 lines
608 B
Vue
Raw Normal View History

2024-10-25 17:27:32 +07:00
<script setup lang="ts">
import { Icon } from '@iconify/vue';
2024-10-25 17:27:32 +07:00
defineProps<{
icon?: string;
title?: string;
titleI18n?: string;
2024-10-25 17:27:32 +07:00
hslaColor?: string;
}>();
</script>
<template>
<div
class="rounded q-px-sm flex-center"
2024-10-25 17:27:32 +07:00
:style="`color: hsla(var(${!!hslaColor ? hslaColor : '--green-6-hsl'}) / 0.8); background: hsla(var(${!!hslaColor ? hslaColor : '--green-6-hsl'}) / 0.1); `"
>
<Icon :icon="icon || 'mdi-circle-medium'" style="margin-right: 0.25rem" />
{{ title || (!!titleI18n ? $t(titleI18n) : '-') }}
</div>
2024-10-25 17:27:32 +07:00
</template>
<style scoped>
div {
display: inline-flex;
}
</style>