feat: allow error variant

This commit is contained in:
Shivam Mishra
2024-11-27 15:56:29 +05:30
parent f2d115d2d7
commit e3eca0dad8
4 changed files with 9 additions and 0 deletions
@@ -75,6 +75,10 @@ const props = defineProps({
type: String,
required: true,
},
error: {
type: String,
default: '',
},
currentUserId: {
type: Number,
required: true,
@@ -91,6 +95,7 @@ const props = defineProps({
*/
const variant = computed(() => {
if (props.private) return MESSAGE_VARIANTS.PRIVATE;
if (props.error) return MESSAGE_VARIANTS.ERROR;
const variants = {
[MESSAGE_TYPES.INCOMING]: MESSAGE_VARIANTS.USER,