29 lines
669 B
Vue
29 lines
669 B
Vue
<script setup>
|
|
import { computed } from 'vue';
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
const props = defineProps({
|
|
count: { type: Number, required: true },
|
|
alignBottom: { type: Boolean, default: false },
|
|
});
|
|
|
|
const { t } = useI18n();
|
|
|
|
const displayCount = computed(() =>
|
|
props.count > 9 ? t('CHAT_LIST.UNREAD_COUNT_OVERFLOW') : props.count
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<span
|
|
v-if="count > 0"
|
|
class="bg-n-teal-9 rounded-full h-4 min-w-4 max-w-5 px-1 w-fit font-medium text-xxs leading-3 text-white inline-grid place-items-center flex-shrink-0"
|
|
:class="{
|
|
'mb-0.5': alignBottom,
|
|
}"
|
|
>
|
|
{{ displayCount }}
|
|
</span>
|
|
<span v-else />
|
|
</template>
|