mirror of
https://github.com/versia-pub/frontend.git
synced 2026-06-14 15:39:15 +02:00
chore: ⬆️ Upgrade to Nuxt 4
Some checks failed
Some checks failed
This commit is contained in:
parent
8debe97f63
commit
7f7cf20311
386 changed files with 2376 additions and 2332 deletions
28
app/components/timelines/timeline-item.vue
Normal file
28
app/components/timelines/timeline-item.vue
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<template>
|
||||
<component :is="itemComponent" :note="type === 'status' ? item : undefined" :notification="type === 'notification' ? item : (undefined as any)" @update="$emit('update', $event)"
|
||||
@delete="$emit('delete', item?.id)" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Notification, Status } from "@versia/client/schemas";
|
||||
import type { z } from "zod";
|
||||
import Thread from "../notes/thread.vue";
|
||||
import NotificationItem from "../notifications/notification.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
item?: z.infer<typeof Status> | z.infer<typeof Notification>;
|
||||
type: "status" | "notification";
|
||||
}>();
|
||||
|
||||
const itemComponent = computed(() => {
|
||||
if (props.type === "status") {
|
||||
return Thread;
|
||||
}
|
||||
|
||||
if (props.type === "notification") {
|
||||
return NotificationItem;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue