feat(frontend): Close notification slider over on click, fix types, delete dead code

This commit is contained in:
2025-10-04 08:17:22 +02:00
parent 03f3369cd7
commit 80592167c8
4 changed files with 14 additions and 13 deletions

View File

@@ -11,7 +11,7 @@
:key="notification.id"
:to="notification.clickTarget"
class="px-3 py-2.5 rounded-md hover:bg-elevated/50 flex items-center gap-3 relative -mx-3 first:-mt-3 last:-mb-3"
@click="handleNotificationClick(notification)"
@click="onNotificationClick(notification)"
>
<UChip
:color="notification.type === 'ERROR' ? 'error' : notification.type === 'WARNING' ? 'warning' : 'primary'"
@@ -54,7 +54,7 @@
{{ notification.type }}
</UBadge>
<UBadge color="neutral" variant="subtle" size="xs">
{{ notification.targetGroup }}
{{ notification.role }}
</UBadge>
</div>
</div>
@@ -65,6 +65,7 @@
<script setup lang="ts">
import { formatTimeAgo } from '@vueuse/core'
import type { NotificationDto } from '~/.api-client'
const emit = defineEmits<{
'update:modelValue': [value: boolean]
@@ -86,4 +87,9 @@ watch(isOpen, async (newValue) => {
await fetchNotifications()
}
})
function onNotificationClick(notification: NotificationDto) {
handleNotificationClick(notification)
emit('update:modelValue', false)
}
</script>