2024-06-29 05:05:50 +02:00
|
|
|
<template>
|
2024-11-30 02:19:32 +01:00
|
|
|
<component :is="itemComponent" :note="item" @update="$emit('update', $event)"
|
2024-06-29 05:05:50 +02:00
|
|
|
@delete="$emit('delete', item?.id)" />
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2024-08-28 00:23:29 +02:00
|
|
|
import type { Notification, Status } from "@versia/client/types";
|
2024-06-29 05:05:50 +02:00
|
|
|
import { computed } from "vue";
|
2024-11-30 02:19:32 +01:00
|
|
|
import NewNoteItem from "../notes/note.vue";
|
2024-06-29 05:05:50 +02:00
|
|
|
import NotificationItem from "../social-elements/notifications/notif.vue";
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
item?: Status | Notification;
|
|
|
|
|
type: "status" | "notification";
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const itemComponent = computed(() => {
|
|
|
|
|
if (props.type === "status") {
|
2024-11-30 02:19:32 +01:00
|
|
|
return NewNoteItem;
|
2024-06-29 05:05:50 +02:00
|
|
|
}
|
|
|
|
|
if (props.type === "notification") {
|
|
|
|
|
return NotificationItem;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
});
|
|
|
|
|
</script>
|