mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
877 B
39 lines
877 B
1 year ago
|
<script setup lang="ts">
|
||
|
import type { TableEventType } from 'nocodb-sdk'
|
||
|
import { AppEvents } from 'nocodb-sdk'
|
||
|
|
||
|
const props = defineProps<{
|
||
|
item: TableEventType
|
||
|
}>()
|
||
|
|
||
|
const item = toRef(props, 'item')
|
||
|
|
||
|
const { navigateToProject } = useGlobal()
|
||
|
|
||
|
const action = computed(() => {
|
||
|
switch (item.value.type) {
|
||
|
case AppEvents.TABLE_CREATE:
|
||
|
return 'created'
|
||
|
case AppEvents.TABLE_UPDATE:
|
||
|
return 'updated'
|
||
|
case AppEvents.TABLE_DELETE:
|
||
|
return 'deleted'
|
||
|
}
|
||
|
})
|
||
|
|
||
|
const onClick = () => {
|
||
|
if (item.value.type === AppEvents.TABLE_DELETE) return
|
||
|
navigateToProject({ projectId: item.value.body.id })
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<NotificationItemWrapper :item="item" @click="onClick">
|
||
|
<div class="text-xs gap-2">
|
||
|
Table
|
||
|
<strong>{{ item.body.title }}</strong>
|
||
|
{{ action }} successfully
|
||
|
</div>
|
||
|
</NotificationItemWrapper>
|
||
|
</template>
|